jfreerails.controller
Class TrainStopsHandler
java.lang.Object
jfreerails.controller.TrainStopsHandler
- All Implemented Interfaces:
- java.io.Serializable
public class TrainStopsHandler
- extends java.lang.Object
- implements java.io.Serializable
- Author:
- Luke
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
private static final java.util.logging.Logger logger
NOT_AT_STATION
private static final int NOT_AT_STATION
- See Also:
- Constant Field Values
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
principal
private final FreerailsPrincipal principal
timeLoadingFinished
private GameTime timeLoadingFinished
trainId
private final int trainId
worldDiffs
private final WorldDiffs worldDiffs
TrainStopsHandler
public TrainStopsHandler(int id,
FreerailsPrincipal p,
WorldDiffs w)
lengthenPath
static PathOnTiles lengthenPath(ReadOnlyWorld w,
PathOnTiles path,
int currentTrainLength)
- If wagons are added to a train, we need to increase its length.
arrivesAtPoint
public ImPoint arrivesAtPoint(int x,
int y)
getMoves
public Move getMoves()
getStationID
public int getStationID(int x,
int y)
- Returns:
- the number of the station the train is currently at, or -1 if no
current station.
getTrainLength
public int getTrainLength()
isTrainFull
public boolean isTrainFull()
isTrainMoving
public boolean isTrainMoving()
isWaiting4FullLoad
public boolean isWaiting4FullLoad()
loadAndUnloadCargo
void loadAndUnloadCargo(int stationId,
boolean waiting,
boolean autoConsist)
makeTrainWait
void makeTrainWait(int ticks)
refreshWaitingForFullLoad
public boolean refreshWaitingForFullLoad()
scheduledStop
private void scheduledStop()
updateSchedule
void updateSchedule()
updateTarget
public void updateTarget()
- Issues a ChangeTrainScheduleMove to set the train to move to the next
station.