|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectMonopoly.Card
public abstract class Card
Abstract class Card. Represents a card of the Monopoly game. Invariant: Once created and until destroyed instances of Card subclasses will have an identifing color(int) and a text(String).
| Constructor Summary | |
|---|---|
Card(java.lang.String t,
int c)
Creates a new Card object. |
|
| Method Summary | |
|---|---|
abstract void |
act(Monopoly game)
Executes the action described by the card's text. |
int |
getColor()
Get the color of the card (Accessor). |
java.lang.String |
getText()
Get the text of the card (Accessor). |
java.lang.String |
toString()
Get a String identifying the card. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Card(java.lang.String t,
int c)
t - the message that appears on the cardc - the color of the card| Method Detail |
|---|
public java.lang.String getText()
public int getColor()
public java.lang.String toString()
toString in class java.lang.Objectpublic abstract void act(Monopoly game)
act in interface Interactivegame - 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 | ||||||||