Monopoly
Class GetMoneyCard

java.lang.Object
  extended by Monopoly.Card
      extended by Monopoly.MoneyCard
          extended by Monopoly.GetMoneyCard
All Implemented Interfaces:
Interactive

public class GetMoneyCard
extends MoneyCard

This is the class GetMoneyCard. Invariant: Once created and until destroyed an instance of this class will represent a GetMoneyCard of the Monopoly game. When drawn the player collects an amount of money.


Constructor Summary
GetMoneyCard(int value, java.lang.String t, int c)
          Creates a new GetMoneyCard object.
 
Method Summary
 void act(Monopoly game)
          Executes the action described by the card's text.
 
Methods inherited from class Monopoly.MoneyCard
getValue
 
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

GetMoneyCard

public GetMoneyCard(int value,
                    java.lang.String t,
                    int c)
Creates a new GetMoneyCard object.

Parameters:
value - the amount to receive
t - the message that appears on the card
c - the color of the card
Method Detail

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