Monopoly
Class PickCard

java.lang.Object
  extended by Monopoly.Cell
      extended by Monopoly.PickCard
All Implemented Interfaces:
Interactive

public class PickCard
extends Cell

This class represents the cell which makes the player to pick a card.
Implementation Invariant: Once created and until destroyed instances of PickCard subclasses will have an identifier color. They will represent a pickCard Cell of the Monopoly game.

See Also:
Cell, Interactive

Constructor Summary
PickCard(java.lang.String name, int location, int color)
          Constructs a new "Pick card" cell.
 
Method Summary
 void act(Monopoly game)
          Makes the player to pick a card from the collection of the cards.
 int getColor()
          Get the color of the card (Accessor).
 
Methods inherited from class Monopoly.Cell
getLocation, getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PickCard

public PickCard(java.lang.String name,
                int location,
                int color)
Constructs a new "Pick card" cell.

Method Detail

getColor

public int getColor()
Get the color of the card (Accessor).

Pre: true
Post: The same color is always returned

Returns:
The color of the card (int)

act

public void act(Monopoly game)
         throws java.lang.NullPointerException
Makes the player to pick a card from the collection of the cards.

Pre: game must be different than null
Post: A card must be picked from the player

Specified by:
act in interface Interactive
Overrides:
act in class Cell
Parameters:
game - the Monopoly instance that represents the game.
Throws:
java.lang.NullPointerException