public class MapTracker
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected StaticBlock |
currentBlock |
protected StaticBlock |
lastBlock |
protected StaticBlock |
nextBlock |
protected boolean |
noNext |
protected boolean |
onSwitch |
protected boolean |
startblock |
protected double |
switchDist |
protected StaticTrack |
theTrack |
protected Train |
theTrain |
| Constructor and Description |
|---|
MapTracker(StaticTrack initTrack,
StaticBlock startBlock,
Train theTrain) |
MapTracker(StaticTrack initTrack,
Train theTrain) |
MapTracker(Train theTrain) |
MapTracker(Train theTrain,
int blockID) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
blockChange()
Checks to see if we've changed blocks.
|
protected double |
distToAuthEnd(double distanceTraveled)
Computes the remaining distance the train can go before reaching the
end of its authority.
|
protected void |
doSwitchBlock(int switchID) |
protected void |
getNextBlock() |
protected java.lang.String |
getStation(int stationID) |
protected double |
minAuth(StaticBlock one,
StaticBlock two) |
void |
setCurrentBlock(StaticBlock startBlock) |
void |
setTrack(StaticTrack initTrack) |
protected StaticBlock currentBlock
protected StaticBlock lastBlock
protected StaticBlock nextBlock
protected StaticTrack theTrack
protected Train theTrain
protected boolean startblock
protected boolean onSwitch
protected boolean noNext
protected double switchDist
public MapTracker(Train theTrain)
public MapTracker(Train theTrain, int blockID)
public MapTracker(StaticTrack initTrack, Train theTrain)
public MapTracker(StaticTrack initTrack, StaticBlock startBlock, Train theTrain)
public void setCurrentBlock(StaticBlock startBlock)
public void setTrack(StaticTrack initTrack)
protected double distToAuthEnd(double distanceTraveled)
distanceTraveled - is the distance along the block the train has already traveledprotected boolean blockChange()
protected void getNextBlock()
protected java.lang.String getStation(int stationID)
protected void doSwitchBlock(int switchID)
protected double minAuth(StaticBlock one, StaticBlock two)