|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectrails.game.TrainType
public class TrainType
| Field Summary | |
|---|---|
protected BooleanState |
available
|
protected boolean |
canBeExchanged
|
protected int |
cityScoreFactor
|
protected int |
cost
|
protected boolean |
countHexes
|
protected int |
exchangeCost
|
protected int |
index
Index: used for sorting trains lists in configured order. |
protected boolean |
infiniteAmount
|
protected java.lang.String |
initialPortfolio
In some cases, trains start their life in the Pool |
protected int |
lastIndex
|
protected static org.apache.log4j.Logger |
log
|
protected int |
majorStops
|
protected int |
minorStops
|
protected java.lang.String |
name
|
static int |
NO_TOWN_COUNT
|
protected IntegerState |
numberBoughtFromIPO
|
protected boolean |
obsoleting
|
protected boolean |
permanent
|
protected int |
quantity
|
protected java.util.List<TrainTypeI> |
releasedTrainTypes
|
protected BooleanState |
rusted
|
protected TrainTypeI |
rustedTrainType
|
protected java.lang.String |
startedPhaseName
|
static int |
TOWN_COUNT_MAJOR
|
static int |
TOWN_COUNT_MINOR
|
protected int |
townCountIndicator
|
protected int |
townScoreFactor
|
protected java.lang.Class<? extends Train> |
trainClass
|
protected java.lang.String |
trainClassName
|
protected TrainManager |
trainManager
|
protected java.util.ArrayList<TrainI> |
trains
|
| Constructor Summary | |
|---|---|
TrainType(boolean real)
|
|
| Method Summary | |
|---|---|
void |
addToBoughtFromIPO()
|
java.lang.Object |
clone()
|
TrainI |
cloneTrain()
Create train without throwing exceptions. |
void |
configureFromXML(Tag tag)
Instructs the component to configure itself from the provided XML element. |
boolean |
countsHexes()
|
protected TrainI |
createTrain()
|
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. |
int |
getCityScoreFactor()
|
int |
getCost()
|
int |
getExchangeCost()
|
int |
getIndex()
|
java.lang.String |
getInfo()
|
int |
getMajorStops()
|
int |
getMinorStops()
|
java.lang.String |
getName()
|
int |
getNumberBoughtFromIPO()
|
java.lang.String |
getReleasedTrainTypeNames()
|
java.util.List<TrainTypeI> |
getReleasedTrainTypes()
|
TrainTypeI |
getRustedTrainType()
|
java.lang.String |
getRustedTrainTypeName()
|
java.lang.String |
getStartedPhaseName()
|
int |
getTownCountIndicator()
|
int |
getTownScoreFactor()
|
TrainManager |
getTrainManager()
|
boolean |
hasInfiniteAmount()
|
boolean |
hasRusted()
|
boolean |
isAvailable()
|
boolean |
isObsoleting()
|
boolean |
isPermanent()
|
boolean |
nextCanBeExchanged()
|
void |
setAvailable(Bank bank)
Make a train type available for buying by public companies. |
void |
setPermanent(boolean permanent)
|
void |
setReleasedTrainTypes(java.util.List<TrainTypeI> releasedTrainTypes)
|
void |
setRusted(Portfolio lastBuyingCompany)
|
void |
setRustedTrainType(TrainTypeI rustedTrainType)
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int TOWN_COUNT_MAJOR
public static final int TOWN_COUNT_MINOR
public static final int NO_TOWN_COUNT
protected java.lang.String trainClassName
protected java.lang.Class<? extends Train> trainClass
protected java.lang.String name
protected int quantity
protected boolean infiniteAmount
protected int index
protected boolean countHexes
protected int townCountIndicator
protected int townScoreFactor
protected int cityScoreFactor
protected boolean canBeExchanged
protected IntegerState numberBoughtFromIPO
protected boolean obsoleting
protected boolean permanent
protected int cost
protected int majorStops
protected int minorStops
protected int exchangeCost
protected java.lang.String startedPhaseName
protected TrainTypeI rustedTrainType
protected java.util.List<TrainTypeI> releasedTrainTypes
protected java.util.ArrayList<TrainI> trains
protected int lastIndex
protected BooleanState available
protected BooleanState rusted
protected TrainManager trainManager
protected java.lang.String initialPortfolio
protected static org.apache.log4j.Logger log
| Constructor Detail |
|---|
public TrainType(boolean real)
real - False for the default type, else real. The default type does
not have top-level attributes.| Method Detail |
|---|
public void configureFromXML(Tag tag)
throws ConfigurationException
ConfigurableComponentI
configureFromXML in interface ConfigurableComponentIConfigurationExceptionrails.game.ConfigurableComponentI#configureFromXML(org.w3c.dom.Element)public void finishConfiguration(GameManagerI gameManager)
ConfigurableComponentIThis 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 ConfigurableComponentIgameManager - 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.
protected TrainI createTrain()
throws ConfigurationException
ConfigurationExceptionpublic TrainI cloneTrain()
cloneTrain in interface TrainTypeIpublic int getCityScoreFactor()
getCityScoreFactor in interface TrainTypeIpublic int getCost()
getCost in interface TrainTypeIpublic boolean countsHexes()
countsHexes in interface TrainTypeIpublic boolean nextCanBeExchanged()
nextCanBeExchanged in interface TrainTypeIpublic void addToBoughtFromIPO()
addToBoughtFromIPO in interface TrainTypeIpublic int getNumberBoughtFromIPO()
getNumberBoughtFromIPO in interface TrainTypeIpublic int getExchangeCost()
getExchangeCost in interface TrainTypeIpublic int getMajorStops()
getMajorStops in interface TrainTypeIpublic int getMinorStops()
getMinorStops in interface TrainTypeIpublic java.lang.String getName()
getName in interface TrainTypeIpublic java.util.List<TrainTypeI> getReleasedTrainTypes()
getReleasedTrainTypes in interface TrainTypeIpublic TrainTypeI getRustedTrainType()
getRustedTrainType in interface TrainTypeIpublic java.lang.String getStartedPhaseName()
getStartedPhaseName in interface TrainTypeIpublic int getTownCountIndicator()
getTownCountIndicator in interface TrainTypeIpublic int getTownScoreFactor()
getTownScoreFactor in interface TrainTypeIpublic java.lang.String getReleasedTrainTypeNames()
getReleasedTrainTypeNames in interface TrainTypeIpublic java.lang.String getRustedTrainTypeName()
getRustedTrainTypeName in interface TrainTypeIpublic boolean isObsoleting()
isObsoleting in interface TrainTypeIpublic void setReleasedTrainTypes(java.util.List<TrainTypeI> releasedTrainTypes)
setReleasedTrainTypes in interface TrainTypeIreleasedTrainType - The releasedTrainType to set.public void setRustedTrainType(TrainTypeI rustedTrainType)
setRustedTrainType in interface TrainTypeIrustedTrainType - The rustedTrainType to set.public boolean isPermanent()
isPermanent in interface TrainTypeIpublic void setPermanent(boolean permanent)
setPermanent in interface TrainTypeIpublic boolean isAvailable()
isAvailable in interface TrainTypeIpublic void setAvailable(Bank bank)
setAvailable in interface TrainTypeIpublic boolean hasInfiniteAmount()
hasInfiniteAmount in interface TrainTypeIpublic void setRusted(Portfolio lastBuyingCompany)
setRusted in interface TrainTypeIpublic boolean hasRusted()
hasRusted in interface TrainTypeIpublic java.lang.Object clone()
clone in class java.lang.Objectpublic int getIndex()
getIndex in interface TrainTypeIpublic TrainManager getTrainManager()
getTrainManager in interface TrainTypeIpublic java.lang.String getInfo()
getInfo in interface TrainTypeIpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||