minor bugfix. next step: implementing the preserveNextRoute action.
Must work in the following conditions: - called from route.setupActions - called from route.startActions - called from route.contactActions - called from autopilot after reaching route.endBlock
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -4,7 +4,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>de.srsoftware</groupId>
|
<groupId>de.srsoftware</groupId>
|
||||||
<artifactId>web4rail</artifactId>
|
<artifactId>web4rail</artifactId>
|
||||||
<version>1.3.69</version>
|
<version>1.3.70</version>
|
||||||
<name>Web4Rail</name>
|
<name>Web4Rail</name>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<description>Java Model Railway Control</description>
|
<description>Java Model Railway Control</description>
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public class PreserveRoute extends Action {
|
|||||||
return false; // train is expected to wait in next block.
|
return false; // train is expected to wait in next block.
|
||||||
}
|
}
|
||||||
|
|
||||||
train.reserveNext();
|
train.reserveRouteAfter(route);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -715,10 +715,10 @@ public class Train extends BaseClass implements Comparable<Train> {
|
|||||||
return tags().iterator();
|
return tags().iterator();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void reserveNext() {
|
public void reserveRouteAfter(Route r) {
|
||||||
LOG.debug("{}.reserveNext()",this);
|
LOG.debug("reserveRouteAfter({})",r);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This turns the train as if it went through a loop. Example:
|
* This turns the train as if it went through a loop. Example:
|
||||||
* before: CabCar→ MiddleCar→ Loco→
|
* before: CabCar→ MiddleCar→ Loco→
|
||||||
@@ -886,6 +886,7 @@ public class Train extends BaseClass implements Comparable<Train> {
|
|||||||
if (trace.contains(tile)) stuckTrace.add(tile);
|
if (trace.contains(tile)) stuckTrace.add(tile);
|
||||||
}
|
}
|
||||||
route.reset();
|
route.reset();
|
||||||
|
route = null;
|
||||||
}
|
}
|
||||||
return properties();
|
return properties();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user