Monopoly
Class PayForEveryBuilding
java.lang.Object
Monopoly.Card
Monopoly.MoneyCard
Monopoly.PayForEveryBuilding
- All Implemented Interfaces:
- Interactive
public class PayForEveryBuilding
- extends MoneyCard
This is the class PayForEveryBuilding.
Invariant: Once created and until destroyed
an instance of this class will represent a PayForEveryBuilding card
of the Monopoly game. When drawn the player pays an amount
of money for every building he ownes.
|
Constructor Summary |
PayForEveryBuilding(int value,
int hT,
java.lang.String t,
int c)
Creates a new PayForEveryBuilding object. |
|
Method Summary |
void |
act(Monopoly game)
Executes the action described by the card's text. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
PayForEveryBuilding
public PayForEveryBuilding(int value,
int hT,
java.lang.String t,
int c)
- Creates a new PayForEveryBuilding object.
- Parameters:
value - the amount to pay for each househT - the amount to pay for each hotelt - the message that appears on the cardc - the color of the card
act
public void act(Monopoly game)
- Executes the action described by the card's text.
- Specified by:
act in interface Interactive- Specified by:
act in class MoneyCard
- Parameters:
game - the Monopoly object where the action
will take place
- Precondition:
- This card has been picked from a Player
- Postcondition:
- The action described has been executed