public GameState NewBoard() { var state = new GameState(); state.WhiteCells = new List<GameBoardCell>() {new Die(), new Die(), new Die(), new Die(), new Die() }; state.BlackCells = new List<GameBoardCell>() {new Die(), new Die(), new Die(), new Die(), new Die() }; state.WhiteCells = state.WhiteCells.OfType<Die>().OrderByDescending(x => x.Value).Cast<GameBoardCell>().ToList(); state.BlackCells = state.BlackCells.OfType<Die>().OrderByDescending(x => x.Value).Cast<GameBoardCell>().ToList(); state.WhiteCells.Add(new GameBoardCell()); state.WhiteCells.Add(new GameBoardCell()); state.WhiteCells = state.WhiteCells.Reverse().ToList(); state.WhiteCells.Add(new GameBoardCell()); state.WhiteCells = state.WhiteCells.Reverse().ToList(); return state; }
// This is wrong! Any move is considered valid! public bool IsValidMove(GameState gameState, Move move) { return true; }
// This is wrong! Any game state is currently considered legal! public bool IsLegalGameState(GameState gameState) { return true; }
// This is wrong! Given a state, the given move options are always empty! public List<Move> GetOptions(GameState state) { return new List<Move>(); }
// This is correct! But none of the ApplyMove calls are... :-( public GameState GetNewStateAfterMove(GameState currentState, Move move) { return move.ApplyMove(currentState); }