Monopoly
Class Cell

java.lang.Object
  extended by Monopoly.Cell
All Implemented Interfaces:
Interactive
Direct Known Subclasses:
GoToJail, PickCard, Property, Taxes

public class Cell
extends java.lang.Object
implements Interactive

This class represents one cell on the board of Monopoly.
Contains methods for seeing the name of the cell and it's location on the board

Implementation invariants: name is constant, location is constant greater than zero

See Also:
Property, GoToJail, Card, Taxes

Constructor Summary
Cell()
          Constructs an empty cell.
Cell(java.lang.String name, int location)
          Constructs an new cell with a specific name and location.
 
Method Summary
 void act(Monopoly game)
          Empty method.
 int getLocation()
          Returns the cardinal number of the cell (Accessor).
 java.lang.String getName()
          Returns the name of the cell (Accessor).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Cell

public Cell()
Constructs an empty cell.


Cell

public Cell(java.lang.String name,
            int location)
Constructs an new cell with a specific name and location.

Method Detail

getName

public java.lang.String getName()
Returns the name of the cell (Accessor).

Pre: name is a valid instance of class String
Post: returns the name of the cell

Returns:
the name of the cell (String)

getLocation

public int getLocation()
Returns the cardinal number of the cell (Accessor).

Pre: location is greater than zero
Post: returns the exact location of the cell

Returns:
the location of the cell (int)

act

public void act(Monopoly game)
Empty method.
Implemented because it is declared in the interface Interactive

Specified by:
act in interface Interactive
Parameters:
game - the Monopoly instance that represents the game.