/// <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); }
/// <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; }
/// <summary> /// singleton constructor, so private /// </summary> private Game() { this.boardState = null; }