예제 #1
0
        /// <summary>
        /// handle the changes for changing turn
        /// </summary>
        /// <param name="hasSkipped">if the transition was because the turn skipped, useful for detecing the end of the game</param>
        public void NextTurn(bool hasSkipped = false)
        {
            this.playerToPlay = this.GetNextPlayer();

            this.turn++;
            this.boardState = new OthelloState(this.board, this.playerToPlay, this.possibleDirections, this.emptyId, this.whiteScore, this.blackScore);
        }
예제 #2
0
 /// <summary>
 /// load a board state and changes to match it
 /// </summary>
 /// <param name="state">state to use</param>
 public void LoadState(OthelloState state)
 {
     this.board        = (int[, ])state.Board.Clone();
     this.emptyId      = state.EmptyId;
     this.whiteScore   = state.WhiteScore;
     this.blackScore   = state.BlackScore;
     this.playerToPlay = state.PlayerId;
     this.boardState   = state;
 }
예제 #3
0
 /// <summary>
 /// singleton constructor, so private
 /// </summary>
 private Game()
 {
     this.boardState = null;
 }