From 618cee8e7064d467d1505d5aa9eeac69026157af Mon Sep 17 00:00:00 2001 From: Arne Keller Date: Tue, 18 Feb 2020 14:50:01 +0100 Subject: [PATCH] Do not print derailed trains when setting switch --- src/edu/kit/informatik/model/ModelRailwaySimulation.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/edu/kit/informatik/model/ModelRailwaySimulation.java b/src/edu/kit/informatik/model/ModelRailwaySimulation.java index 2a92cee..861714f 100644 --- a/src/edu/kit/informatik/model/ModelRailwaySimulation.java +++ b/src/edu/kit/informatik/model/ModelRailwaySimulation.java @@ -93,7 +93,7 @@ public class ModelRailwaySimulation { public boolean setSwitch(final int id, final Vector2D position) { boolean success = railNetwork.setSwitch(id, position); if (success) { - // derail trains on switch TODO: await forum answer on printing derailed trains + // derail trains on switch, explicitly not (!) printing any removed trains (source: forum post) trains.values().stream().filter(train -> train.isOnRail(id)).forEach(Train::removeFromRails); } return success;