예제 #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);
        }