Monopoly
Class TrainStation

java.lang.Object
  extended by Monopoly.Cell
      extended by Monopoly.Property
          extended by Monopoly.TrainStation
All Implemented Interfaces:
Collectable, Interactive

public class TrainStation
extends Property

This class represents the TrainStation cells. The TrainStation cells can be purchaced and a visitor pays a rent to the owner of them.

See Also:
Property

Constructor Summary
TrainStation(java.lang.String name, int location, int price, int rent)
          Constructs a new TrainStation cell with a specific name, location, price and rent
 
Method Summary
 int getRent()
          Returns the rent to be paid by a player who lands on this train station (Accessor).
 
Methods inherited from class Monopoly.Property
act, getOwner, getOwnerName, getPrice, ismortaged, mortage, setOwner, toString, unmortage
 
Methods inherited from class Monopoly.Cell
getLocation, getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TrainStation

public TrainStation(java.lang.String name,
                    int location,
                    int price,
                    int rent)
Constructs a new TrainStation cell with a specific name, location, price and rent

Method Detail

getRent

public int getRent()
Returns the rent to be paid by a player who lands on this train station (Accessor).

Pre: true
Post: if the owner has more than one train station, 50 euros are added to the rent

Specified by:
getRent in class Property
Returns:
The rent of the train station (int)