DrawDevelopmentCard() public method

Let a player draw a development card If the player doesn't have enough resources a InsufficientResourcesException is thrown If the development card stack is empty a NoMoreCardsException is thrown Resources to pay for the card are removed from the player hand and returned to the resource bank
public DrawDevelopmentCard ( Player player ) : GameState
player Player The player drawing a development card
return GameState
Exemplo n.º 1
0
        //Development cards

        public GameState DrawDevelopmentCard()
        {
            if (!valid)
            {
                throw new IllegalActionException("Tried to perform an action on an invalid GameAction");
            }
            if (!isAfterDieRoll)
            {
                throw new IllegalActionException("Tried to draw developmentcard before the die roll");
            }
            var result = controller.DrawDevelopmentCard(player);

            return(result);
        }