|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectMonopoly.Card
Monopoly.MoneyCard
public abstract class MoneyCard
This is the abstract class MoneyCard. Invariant: Once created and until destroyed an instance of a subclass will represent a MoneyCard of the Monopoly game. It always has an amount of money (greater than zero). When drawn the player either pays or collects that amount of money.
| Constructor Summary | |
|---|---|
MoneyCard(int value,
java.lang.String t,
int c)
Creates a new MoneyCard object. |
|
| Method Summary | |
|---|---|
abstract void |
act(Monopoly game)
Executes the action described by the card's text. |
int |
getValue()
Returns the amount of money to be payed or received. |
| Methods inherited from class Monopoly.Card |
|---|
getColor, getText, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MoneyCard(int value,
java.lang.String t,
int c)
value - the amount to pay or receivet - the message that appears on the cardc - the color of the card| Method Detail |
|---|
public int getValue()
public abstract void act(Monopoly game)
act in interface Interactiveact in class Cardgame - the Monopoly object where the action
will take place
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||