|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrails.game.TrainManager
public class TrainManager
Field Summary | |
---|---|
protected BooleanState |
anyTrainBought
Required for the sell-train-to-foreigners feature of some games |
protected Bank |
bank
|
protected java.util.List<PublicCompanyI> |
companiesWithExcessTrains
|
protected GameManagerI |
gameManager
|
protected Portfolio |
ipo
|
protected java.util.List<TrainTypeI> |
lTrainTypes
|
protected java.util.Map<java.lang.String,TrainTypeI> |
mTrainTypes
|
protected IntegerState |
newTypeIndex
|
protected boolean |
phaseHasChanged
|
protected boolean |
trainAvailabilityChanged
|
protected java.util.Map<java.lang.String,TrainI> |
trainMap
|
(package private) boolean |
trainPriceAtFaceValueIfDifferentPresidents
|
protected boolean |
trainsHaveRusted
|
protected Portfolio |
unavailable
|
Constructor Summary | |
---|---|
TrainManager()
No-args constructor. |
Method Summary | |
---|---|
void |
addTrain(java.lang.String uniqueID,
TrainI train)
|
void |
checkTrainAvailability(TrainI train,
Portfolio from)
This method handles any consequences of new train buying (from the IPO), such as rusting and phase changes. |
void |
configureFromXML(Tag tag)
Instructs the component to configure itself from the provided XML element. |
void |
finishConfiguration(GameManagerI gameManager)
This method is intended to be called for each configurable component, to perforn any initialisation activities that require any other components to be initialised first. |
java.util.List<TrainI> |
getAvailableNewTrains()
|
TrainI |
getTrainByUniqueId(java.lang.String id)
|
java.lang.String |
getTrainCostOverview()
|
java.util.List<TrainTypeI> |
getTrainTypes()
|
TrainTypeI |
getTypeByName(java.lang.String name)
|
boolean |
hasAvailabilityChanged()
|
boolean |
hasPhaseChanged()
|
boolean |
isAnyTrainBought()
|
void |
resetAvailabilityChanged()
|
void |
setAnyTrainBought(boolean newValue)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.List<TrainTypeI> lTrainTypes
protected java.util.Map<java.lang.String,TrainTypeI> mTrainTypes
protected java.util.Map<java.lang.String,TrainI> trainMap
protected Portfolio unavailable
protected IntegerState newTypeIndex
protected boolean trainsHaveRusted
protected boolean phaseHasChanged
protected boolean trainAvailabilityChanged
protected java.util.List<PublicCompanyI> companiesWithExcessTrains
protected GameManagerI gameManager
protected Bank bank
protected BooleanState anyTrainBought
protected Portfolio ipo
boolean trainPriceAtFaceValueIfDifferentPresidents
Constructor Detail |
---|
public TrainManager()
Method Detail |
---|
public void configureFromXML(Tag tag) throws ConfigurationException
ConfigurableComponentI
configureFromXML
in interface ConfigurableComponentI
ConfigurationException
rails.game.ConfigurableComponentI#configureFromXML(org.w3c.dom.Element)
public void finishConfiguration(GameManagerI gameManager) throws ConfigurationException
ConfigurableComponentI
This method should be called where necessary after all XML file parsing has completed, so that all objects that need to be related to do exist.
finishConfiguration
in interface ConfigurableComponentI
gameManager
- The 'parent' configurable component is passed to allow
the 'child' to access any other object without the need to resort to
static calls where possible.
ConfigurationException
public void addTrain(java.lang.String uniqueID, TrainI train)
public TrainI getTrainByUniqueId(java.lang.String id)
public void checkTrainAvailability(TrainI train, Portfolio from)
public java.util.List<TrainI> getAvailableNewTrains()
public java.lang.String getTrainCostOverview()
public TrainTypeI getTypeByName(java.lang.String name)
public java.util.List<TrainTypeI> getTrainTypes()
public boolean hasAvailabilityChanged()
public void resetAvailabilityChanged()
public boolean hasPhaseChanged()
public boolean isAnyTrainBought()
public void setAnyTrainBought(boolean newValue)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |