TradeBank() public method

Trade resources with the bank If no harbor is owned trading is 4 : 1 If a general harbor is owned trading is 3 : 1 Special harbors trade a specific resource 2 : 1
public TradeBank ( Player player, Resource giving, Resource receiving ) : GameState
player Player The player wanting to trade
giving Resource The resource that the player want to give
receiving Resource The resource that the player want to receive
return GameState
Exemplo n.º 1
0
 public GameState TradeBank(Resource giving, Resource receiving)
 {
     if (!valid)
     {
         throw new IllegalActionException("Tried to trade on an invalid GameAction");
     }
     if (!isAfterDieRoll)
     {
         throw new IllegalActionException("Tried to trade before the die roll");
     }
     return(controller.TradeBank(player, giving, receiving));
 }