|
||||||||||
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 ConfigurableComponentI
ConfigurationException
rails.game.ConfigurableComponentI#configureFromXML(org.w3c.dom.Element)
public void finishConfiguration(GameManagerI gameManager)
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.protected TrainI createTrain() throws ConfigurationException
ConfigurationException
public TrainI cloneTrain()
cloneTrain
in interface TrainTypeI
public int getCityScoreFactor()
getCityScoreFactor
in interface TrainTypeI
public int getCost()
getCost
in interface TrainTypeI
public boolean countsHexes()
countsHexes
in interface TrainTypeI
public boolean nextCanBeExchanged()
nextCanBeExchanged
in interface TrainTypeI
public void addToBoughtFromIPO()
addToBoughtFromIPO
in interface TrainTypeI
public int getNumberBoughtFromIPO()
getNumberBoughtFromIPO
in interface TrainTypeI
public int getExchangeCost()
getExchangeCost
in interface TrainTypeI
public int getMajorStops()
getMajorStops
in interface TrainTypeI
public int getMinorStops()
getMinorStops
in interface TrainTypeI
public java.lang.String getName()
getName
in interface TrainTypeI
public java.util.List<TrainTypeI> getReleasedTrainTypes()
getReleasedTrainTypes
in interface TrainTypeI
public TrainTypeI getRustedTrainType()
getRustedTrainType
in interface TrainTypeI
public java.lang.String getStartedPhaseName()
getStartedPhaseName
in interface TrainTypeI
public int getTownCountIndicator()
getTownCountIndicator
in interface TrainTypeI
public int getTownScoreFactor()
getTownScoreFactor
in interface TrainTypeI
public java.lang.String getReleasedTrainTypeNames()
getReleasedTrainTypeNames
in interface TrainTypeI
public java.lang.String getRustedTrainTypeName()
getRustedTrainTypeName
in interface TrainTypeI
public boolean isObsoleting()
isObsoleting
in interface TrainTypeI
public void setReleasedTrainTypes(java.util.List<TrainTypeI> releasedTrainTypes)
setReleasedTrainTypes
in interface TrainTypeI
releasedTrainType
- The releasedTrainType to set.public void setRustedTrainType(TrainTypeI rustedTrainType)
setRustedTrainType
in interface TrainTypeI
rustedTrainType
- The rustedTrainType to set.public boolean isPermanent()
isPermanent
in interface TrainTypeI
public void setPermanent(boolean permanent)
setPermanent
in interface TrainTypeI
public boolean isAvailable()
isAvailable
in interface TrainTypeI
public void setAvailable(Bank bank)
setAvailable
in interface TrainTypeI
public boolean hasInfiniteAmount()
hasInfiniteAmount
in interface TrainTypeI
public void setRusted(Portfolio lastBuyingCompany)
setRusted
in interface TrainTypeI
public boolean hasRusted()
hasRusted
in interface TrainTypeI
public java.lang.Object clone()
clone
in class java.lang.Object
public int getIndex()
getIndex
in interface TrainTypeI
public TrainManager getTrainManager()
getTrainManager
in interface TrainTypeI
public java.lang.String getInfo()
getInfo
in interface TrainTypeI
public 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 |