mirror of
https://gitlab.com/arnekeller/kit-programmieren-ws1920-final1.git
synced 2024-11-24 09:24:58 +00:00
Actually remove crashed trains
This commit is contained in:
parent
302b755ee6
commit
fa62ba267f
@ -479,6 +479,7 @@ public class ModelRailwaySimulation {
|
|||||||
|| occupiedByOtherTrainPreviously.stream().anyMatch(occupiedByThisTrain::contains);
|
|| occupiedByOtherTrainPreviously.stream().anyMatch(occupiedByThisTrain::contains);
|
||||||
if (anyIntersection) {
|
if (anyIntersection) {
|
||||||
train.removeFromRails();
|
train.removeFromRails();
|
||||||
|
otherTrain.removeFromRails();
|
||||||
// try to find/merge existing collisions
|
// try to find/merge existing collisions
|
||||||
Set<Train> existingCollision = null;
|
Set<Train> existingCollision = null;
|
||||||
for (Set<Train> collision : collisions) {
|
for (Set<Train> collision : collisions) {
|
||||||
|
Loading…
Reference in New Issue
Block a user