Exemplo n.º 1
0
        public bool Play(AGameTurn action)
        {
            if (DiceGameState == DiceGameStates.Running && ((!(action is RerollTurn) || _currentBoard.IsRerollPossible()) && action.ValidateGameAction(this)))
            {
                action.PlayGameAction(this);
                CurrentBoard.CheckInstantRules(this);
                CheckRoundEnd();
                CheckGameEnd();
                if (_diceGameState == DiceGameStates.Running)
                {
                    ActionEndedEvent?.Invoke(new GameTurnEndedEventArgs(this, action));
                }

                return(true);
            }

            return(false);
        }
Exemplo n.º 2
0
 public bool CanBePlayed(AGameTurn action)
 {
     return(action.ValidateGameAction(this));
 }