Monopoly
Class GoToJail

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

public class GoToJail
extends Cell

This class represents the cell of Monopoly which sent the player to the Jail.
When a player lands on this cell, he is sent to the Cell which represents the Jail

See Also:
Cell, Interactive

Constructor Summary
GoToJail(java.lang.String name, int location)
          Constructs a new "Go to jail" cell.
 
Method Summary
 void act(Monopoly game)
          Forces the player to go to the "Jail" cell.
 
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

GoToJail

public GoToJail(java.lang.String name,
                int location)
Constructs a new "Go to jail" cell.

Method Detail

act

public void act(Monopoly game)
Forces the player to go to the "Jail" cell.

The action of this cell is to send the player to the "Jail" cell and
change the player's condition to prisoner

Pre: game must be different than null
Post: the player moves to the "Jail" cell

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