Class CandidateMoves
- java.lang.Object
-
- com.barrybecker4.game.twoplayer.gomoku.CandidateMoves
-
- Direct Known Subclasses:
TicTacToeCandidateMoves
public class CandidateMoves extends java.lang.ObjectRepresentation of the candidate next moves on a GoMoku Game Board. Immutable after construction.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedCandidateMoves()For internal use onlyCandidateMoves(GoMokuBoard board)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddetermineCandidateMoves(GoMokuBoard board)This method splats a footprint of trues around the current moves.booleanisCandidateMove(int row, int col)We consider only those spaces bordering on non-empty spaces.voidsetCandidate(BoardPosition pos)
-
-
-
Constructor Detail
-
CandidateMoves
public CandidateMoves(GoMokuBoard board)
Constructor- Parameters:
board- the gomoku board to determine candidate moves for
-
CandidateMoves
protected CandidateMoves()
For internal use only
-
-
Method Detail
-
isCandidateMove
public boolean isCandidateMove(int row, int col)We consider only those spaces bordering on non-empty spaces. In theory all empties should be considered, but in practice only those bordering existing moves are likely to be favorable.- Returns:
- true if this position is a possible next move
-
setCandidate
public void setCandidate(BoardPosition pos)
-
determineCandidateMoves
protected void determineCandidateMoves(GoMokuBoard board)
This method splats a footprint of trues around the current moves. later we look for empty spots that are true for candidate moves.
-
-