Class CachedBoard
- java.lang.Object
-
- org.swtpra1.alphabetaplayer.hippolyta.model.Board
-
- org.swtpra1.alphabetaplayer.hippolyta.CachedBoard
-
public class CachedBoard extends Board
-
-
Field Summary
Fields Modifier and Type Field Description Turn.Coordinate[][]
amazonePositions
int[][]
emptyNeighborSquares
-
Constructor Summary
Constructors Constructor Description CachedBoard()
creates a cached board with default values that match the default initial board of the game
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CachedBoard
copy()
creates a deep copy of the cached boardvoid
updateCache(Turn turn, PlayerColor player)
updates the cache with the information from the next turn.void
updateCacheUndo(Turn turn, PlayerColor player)
updates the cache with the information from the previous turn.-
Methods inherited from class org.swtpra1.alphabetaplayer.hippolyta.model.Board
equals, getSquareSafe, hashCode, toString
-
-
-
-
Field Detail
-
amazonePositions
public Turn.Coordinate[][] amazonePositions
-
emptyNeighborSquares
public int[][] emptyNeighborSquares
-
-
Method Detail
-
updateCache
public void updateCache(Turn turn, PlayerColor player)
updates the cache with the information from the next turn. needs to be called before the squares of the board get changed.- Parameters:
turn
- that will be executed on the boardplayer
- the player that will make the turn
-
updateCacheUndo
public void updateCacheUndo(Turn turn, PlayerColor player)
updates the cache with the information from the previous turn. needs to be called before the squares of the board get changed.- Parameters:
turn
- that will be undone on the boardplayer
- the player that made the turn
-
copy
public CachedBoard copy()
creates a deep copy of the cached board
-
-