Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }