added two new conditions: CarInTrain and CarOrientation

This commit is contained in:
Stephan Richter
2020-12-10 11:30:33 +01:00
parent 1b7103ffbd
commit 0855a943eb
11 changed files with 190 additions and 25 deletions

View File

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