protected bool TryMakeMove(IMove <TGameState, TField, TPosition, TCell> move) { var newState = move.Make(CurrentState); if (ReferenceEquals(newState, null)) { return(false); } states.Push(newState); return(true); }
public bool TryMakeMove(IMove <ReversiGameState> move) { var newState = move.Make(CurrentState); if (newState == null) { return(false); } gameStates.Add(newState); if (!GetPossibleMoves().Any()) { gameStates.Add(new ReversiGameState(newState.Board, CurrentPlayerId ^ 1)); } return(true); }