Class Square

java.lang.Object
com.mygdx.game.Logic.Squares.Square
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
CardSquare, CourseSquare, MoneySquare, TurnSquare

public abstract class Square
extends java.lang.Object
implements java.io.Serializable
Main component of the Board class
See Also:
Serialized Form
  • Field Summary

    Fields
    Modifier and Type Field Description
    protected java.lang.String name  
  • Constructor Summary

    Constructors
    Constructor Description
    Square​(java.lang.String name)  
  • Method Summary

    Modifier and Type Method Description
    int getI()  
    int getJ()  
    java.lang.String getName()  
    abstract void runAction​(GameInstance game)
    To be run when the Player lands on this square
    void setIJ​(int i, int j)
    To be set during initialization of the Board
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • name

      protected final java.lang.String name
  • Constructor Details

    • Square

      public Square​(java.lang.String name)
  • Method Details

    • runAction

      public abstract void runAction​(GameInstance game)
      To be run when the Player lands on this square
      Parameters:
      game - The current Game Instance
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object
    • getName

      public java.lang.String getName()
      Returns:
      The name of the square
    • getI

      public int getI()
      Returns:
      The number of the side it belongs [0-4]
    • getJ

      public int getJ()
      Returns:
      The number of the square counting from the right corner of the side [0-...]
    • setIJ

      public void setIJ​(int i, int j)
      To be set during initialization of the Board
      Parameters:
      i - The number of the side it belongs [0-4]
      j - The number of the square counting from the right corner of the side [0-...]