PlayMonopoly() public méthode

Let a player play a Monopoly development card If the player doesn't have a Monopoly card on his hand a InsufficientResourcesException is thrown All resources of the given type is removed from players hands and all given to the playing player
public PlayMonopoly ( Player player, Resource resource ) : GameState
player Player The player playing the monopoly development card
resource Resource The resource to get monopoly on
Résultat GameState
Exemple #1
0
 public GameState PlayMonopoly(Resource resource)
 {
     if (!valid)
     {
         throw new IllegalActionException("Tried to perform an action on an invalid GameAction");
     }
     if (hasPlayedDevCard)
     {
         throw new IllegalActionException("Max one development card can be played each turn");
     }
     hasPlayedDevCard = true;
     return(controller.PlayMonopoly(player, resource));
 }