reservation of next route now possible before route start

This commit is contained in:
Stephan Richter
2020-12-04 18:35:30 +01:00
parent 87751bff25
commit 18e2753682
5 changed files with 51 additions and 30 deletions

View File

@@ -115,7 +115,7 @@ public abstract class Tile extends BaseClass implements Comparable<Tile>{
public boolean isFreeFor(Train newTrain) {
if (disabled) return false;
if (isSet(route) && route.train != newTrain) return false;
if (isSet(route) && isSet(route.train()) && route.train() != newTrain) return false;
if (isSet(train) && train != newTrain) return false;
return true;
}
@@ -223,7 +223,9 @@ public abstract class Tile extends BaseClass implements Comparable<Tile>{
if (isTrack) {
formInputs.add(t("Length"),new Input(LENGTH,length).numeric().addTo(new Tag("span")).content(NBSP+lengthUnit));
formInputs.add(t("State"),new Checkbox(DISABLED, t("disabled"), disabled));
Checkbox checkbox = new Checkbox(DISABLED, t("disabled"),disabled);
if (disabled) checkbox.clazz("disabled");
formInputs.add(t("State"),checkbox);
}
List<Direction> pd = possibleDirections();