Class Board
- java.lang.Object
-
- org.swtpra1.alphabetaplayer.hippolyta.model.Board
-
- Direct Known Subclasses:
CachedBoard
public class Board extends java.lang.Object
configuration and state of a game board
-
-
Field Summary
Fields Modifier and Type Field Description int
columns
int
rows
BoardSquare[][]
squares
-
Constructor Summary
Constructors Constructor Description Board(int rows, int columns)
creates and initializes the board object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Board
copy()
creates a deep copy of the boardboolean
equals(java.lang.Object o)
BoardSquare
getSquareSafe(Turn.Coordinate coordinate)
gets the square at the given coordinate and returning ARROW when the coordinate is not on the board (out of Bound)int
hashCode()
java.lang.String
toString()
-
-
-
Field Detail
-
rows
@SerializedName("gameSizeRows") public int rows
-
columns
@SerializedName("gameSizeColumns") public int columns
-
squares
@SerializedName("squares") public BoardSquare[][] squares
-
-
Method Detail
-
getSquareSafe
public BoardSquare getSquareSafe(Turn.Coordinate coordinate)
gets the square at the given coordinate and returning ARROW when the coordinate is not on the board (out of Bound)- Parameters:
coordinate
- the coordinate at which the square should be examined- Returns:
- which square is considered to be on the board at the coordinate
-
copy
public Board copy()
creates a deep copy of the board- Returns:
- new board
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-