|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectMonopoly.Card
Monopoly.GetOutOfJailCard
public class GetOutOfJailCard
This is the class GetOutOfJailCard. Invariant: Once created and until destroyed an instance of this class will represent a GetOutOfJailCard of the Monopoly game. When drawn it can be kept and used or sold later.
| Constructor Summary | |
|---|---|
GetOutOfJailCard(java.lang.String t,
int c)
Creates a new GetOutOfJailCard object. |
|
| Method Summary | |
|---|---|
void |
act(Monopoly game)
Executes the action described by the card's text. |
Player |
getOwner()
Get the owner of this card (Accessor). |
void |
setOwner(Player owner)
Set the owner of this card (Transformer). |
void |
use(Monopoly game)
Releases the owner of this card from prison. |
| 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 GetOutOfJailCard(java.lang.String t,
int c)
t - the message that appears on the cardc - the color of the card| Method Detail |
|---|
public Player getOwner()
getOwner in interface Collectablepublic void setOwner(Player owner)
setOwner in interface Collectableowner - the Player object to be set as owner of this card
public void act(Monopoly game)
act in interface Interactiveact in class Cardgame - the Monopoly object where the action
will take place
public void use(Monopoly game)
game - 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 | ||||||||