rails.game
Class Bonus

java.lang.Object
  extended by rails.game.Bonus
All Implemented Interfaces:
RevenueStaticModifier, Closeable

public class Bonus
extends java.lang.Object
implements Closeable, RevenueStaticModifier

An object of class Bonus represent extra income for the owning company, usually connected to certain map locations.

Currently, Bonus objects will be created in the following cases:
1. when a SpecialTokenLay containing a BonusToken is exercised,
2. when a private having a LocatedBonus special property is bought by a public company,
3. when a sellable bonus is bought from such a public company by another company.

Author:
VosE

Constructor Summary
Bonus(PublicCompanyI owner, java.lang.String name, int value, java.util.List<MapHex> locations)
           
 
Method Summary
 void close()
          Remove the bonus This method can be called by a certain phase when it starts.
 boolean equals(Bonus b)
           
 java.lang.String getClosingInfo()
           
 java.lang.String getIdForView()
           
 java.util.List<MapHex> getLocations()
           
 java.lang.String getName()
           
 PublicCompanyI getOwner()
           
 int getValue()
           
 boolean isExecutionable()
           
 void modifyCalculator(RevenueAdapter revenueAdapter)
          Add bonus value to revenue calculator
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Bonus

public Bonus(PublicCompanyI owner,
             java.lang.String name,
             int value,
             java.util.List<MapHex> locations)
Method Detail

isExecutionable

public boolean isExecutionable()

getOwner

public PublicCompanyI getOwner()

getLocations

public java.util.List<MapHex> getLocations()

getIdForView

public java.lang.String getIdForView()

getName

public java.lang.String getName()

getValue

public int getValue()

close

public void close()
Remove the bonus This method can be called by a certain phase when it starts. See prepareForRemovel().

Specified by:
close in interface Closeable

equals

public boolean equals(Bonus b)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getClosingInfo

public java.lang.String getClosingInfo()
Specified by:
getClosingInfo in interface Closeable

modifyCalculator

public void modifyCalculator(RevenueAdapter revenueAdapter)
Add bonus value to revenue calculator

Specified by:
modifyCalculator in interface RevenueStaticModifier