rails.game
Class Train
java.lang.Object
rails.game.Train
- All Implemented Interfaces:
- Moveable, TrainI
- Direct Known Subclasses:
- NameableTrain
public class Train
- extends java.lang.Object
- implements TrainI
|
Constructor Summary |
Train()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
type
protected TrainTypeI type
majorStops
protected int majorStops
minorStops
protected int minorStops
cost
protected int cost
cityScoreFactor
protected int cityScoreFactor
townScoreFactor
protected int townScoreFactor
townCountIndicator
protected int townCountIndicator
tradeable
protected boolean tradeable
- Some specific trains cannot be traded between companies
uniqueId
protected java.lang.String uniqueId
holder
protected Portfolio holder
obsolete
protected BooleanState obsolete
log
protected static org.apache.log4j.Logger log
Train
public Train()
init
public void init(TrainTypeI type,
int index)
- Specified by:
init in interface TrainI
getUniqueId
public java.lang.String getUniqueId()
- Specified by:
getUniqueId in interface TrainI
getCityScoreFactor
public int getCityScoreFactor()
- Specified by:
getCityScoreFactor in interface TrainI
- Returns:
- Returns the cityScoreFactor.
getCost
public int getCost()
- Specified by:
getCost in interface TrainI
- Returns:
- Returns the cost.
getMajorStops
public int getMajorStops()
- Specified by:
getMajorStops in interface TrainI
- Returns:
- Returns the majorStops.
getMinorStops
public int getMinorStops()
- Specified by:
getMinorStops in interface TrainI
- Returns:
- Returns the minorStops.
getTownCountIndicator
public int getTownCountIndicator()
- Specified by:
getTownCountIndicator in interface TrainI
- Returns:
- Returns the townCountIndicator.
getTownScoreFactor
public int getTownScoreFactor()
- Specified by:
getTownScoreFactor in interface TrainI
- Returns:
- Returns the townScoreFactor.
getType
public TrainTypeI getType()
- Specified by:
getType in interface TrainI
- Returns:
- Returns the type.
getName
public java.lang.String getName()
- Specified by:
getName in interface Moveable- Specified by:
getName in interface TrainI
getHolder
public Portfolio getHolder()
- Specified by:
getHolder in interface Moveable- Specified by:
getHolder in interface TrainI
getOwner
public CashHolder getOwner()
- Specified by:
getOwner in interface TrainI
isObsolete
public boolean isObsolete()
- Specified by:
isObsolete in interface TrainI
setHolder
public void setHolder(Portfolio newHolder)
- Move the train to another Portfolio.
- Specified by:
setHolder in interface TrainI
moveTo
public void moveTo(MoveableHolder to)
- Specified by:
moveTo in interface Moveable
setRusted
public void setRusted()
- Specified by:
setRusted in interface TrainI
setObsolete
public void setObsolete()
- Specified by:
setObsolete in interface TrainI
canBeExchanged
public boolean canBeExchanged()
- Specified by:
canBeExchanged in interface TrainI
toDisplay
public java.lang.String toDisplay()
- Specified by:
toDisplay in interface TrainI
isTradeable
public boolean isTradeable()
- Specified by:
isTradeable in interface TrainI
setTradeable
public void setTradeable(boolean tradeable)
- Specified by:
setTradeable in interface TrainI