This commit is contained in:
Stephan Richter
2020-12-10 10:16:21 +01:00
parent 68f08f012f
commit 1b7103ffbd
5 changed files with 11 additions and 2 deletions

View File

@@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>de.srsoftware</groupId>
<artifactId>web4rail</artifactId>
<version>1.2.37</version>
<version>1.2.38</version>
<name>Web4Rail</name>
<packaging>jar</packaging>
<description>Java Model Railway Control</description>

View File

@@ -7,6 +7,7 @@ ActivateRoute : Route aktivieren
add : hinzufügen
Added {} : {} hinzugefügt
add action : Aktion hinzufügen
Add action to action list : Aktion zur Liste hinzufügen
add car\: : Waggon hinzufügen:
Add condition : Bedingung hinzufügen
add locomotive\: : Lok hinzufügen:

View File

@@ -406,6 +406,10 @@ public class Route extends BaseClass {
return win;
}
public Context context() {
return context.clone();
}
public Block endBlock() {
return endBlock;
}

View File

@@ -274,6 +274,7 @@ public abstract class Block extends StretchableTile{
Id trainId = Id.from(params,Train.class.getSimpleName());
if (trainId.equals(0)) { // TODO: this is rubbish
if (isSet(train)) train.dropTrace();
train.set(null);
train = null;
} else {
Train newTrain = Train.get(trainId);

View File

@@ -75,12 +75,15 @@ public class Contact extends Tile{
LOG.debug("{} activated.",this);
state = true;
if (isSet(timer)) timer.abort();
Context context = null;
if (isSet(route)) {
context = route.context();
route.contact(this);
} else if (getClass() != Contact.class) {
plan.warn(this);
}
actions.fire(new Context(this));
if (isNull(context)) context = new Context(this);
actions.fire(context);
stream();
}
}