예제 #1
0
 /// <summary>
 /// Attempt to resolve ambiguous jump move.  The longest move matching the first
 /// location and last location is selected.
 /// </summary>
 /// <param name="board">The board</param>
 /// <param name="move">The possibly ambiguos move</param>
 /// <returns><c>true</c> if move could be resolved</returns>
 public Move ResolveAmbiguousMove(IBoard board, Move move)
 {
     return(CheckerMoveRules.ResolveAmbiguousMove(board, move));
 }
예제 #2
0
 /// <summary>
 /// Is the game over
 /// </summary>
 /// <param name="board">The board state</param>
 /// <param name="turn">The player with the current turn</param>
 /// <returns><c>true</c> if the game is over and <c>false</c> false if otherwise</returns>
 public bool IsGameOver(IBoard board, Player turn)
 {
     return(!CheckerMoveRules.HasMovesAvailable(board, turn));
 }
예제 #3
0
 /// <summary>
 /// Apply the given move to the board
 /// </summary>
 /// <param name="board">The board state</param>
 /// <param name="move">The move to apply to the board</param>
 /// <returns><c>true</c> if the move was applied successfully</returns>
 public bool ApplyMove(IBoard board, Move move)
 {
     CheckerMoveRules.UpdateBoard(board, move);
     return(true);
 }
예제 #4
0
 /// <summary>
 /// Check if the given move is valid for the given state
 /// </summary>
 /// <param name="board">The board state</param>
 /// <param name="move">The move</param>
 /// <param name="player">The player that made the move</param>
 /// <returns>The status of the move</returns>
 public MoveStatus IsValidMove(IBoard board, Move move, Player player)
 {
     return(CheckerMoveRules.IsMoveLegal(board, move, player));
 }