Package com.mygdx.game.Logic.Squares
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
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
To be run when thePlayer
lands on this square- Parameters:
game
- The current Game Instance
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.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 theBoard
- 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-...]
-