Monopoly
Class Company

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

public class Company
extends Property

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

See Also:
Property

Constructor Summary
Company(java.lang.String name, int location, int price)
          Constructs a new company cell with a specific name, location and price
 
Method Summary
 int getRent()
          Returns the rent to be paid by a player who lands on this company (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

Company

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

Method Detail

getRent

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

Pre: true
Post: the rent is the result of a roll and it depends on how many companies the owner has

Specified by:
getRent in class Property
Returns:
The rent to be paid (int)