rails.game
Class Bonus
java.lang.Object
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Bonus
public Bonus(PublicCompanyI owner,
java.lang.String name,
int value,
java.util.List<MapHex> locations)
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