implemented pre-reservation of routes when autopilot is active
This commit is contained in:
@@ -122,7 +122,7 @@ public abstract class Block extends StretchableTile implements Comparable<Block>
|
||||
|
||||
@Override
|
||||
public Object click() throws IOException {
|
||||
if (isSet(train)) return train.props();
|
||||
if (isSet(train)) return train.properties();
|
||||
return super.click();
|
||||
}
|
||||
|
||||
@@ -165,13 +165,13 @@ public abstract class Block extends StretchableTile implements Comparable<Block>
|
||||
return null;
|
||||
}
|
||||
|
||||
public Range getWaitTime(Train train) {
|
||||
public Range getWaitTime(Train train,Direction dir) {
|
||||
for (WaitTime wt : waitTimes) {
|
||||
if (train.tags().contains(wt.tag)) {
|
||||
return wt.get(train.direction());
|
||||
}
|
||||
}
|
||||
return getWaitTime(NO_TAG).get(train.direction());
|
||||
return getWaitTime(NO_TAG).get(dir);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -118,7 +118,7 @@ public abstract class Tile extends BaseClass{
|
||||
|
||||
public boolean isFreeFor(Train newTrain) {
|
||||
if (disabled) return false;
|
||||
if (isSet(route)) return false;
|
||||
if (isSet(route) && route.train != newTrain) return false;
|
||||
if (isSet(train) && train != newTrain) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user