mirror of
https://gitlab.com/arnekeller/kit-programmieren-ws1920-final1.git
synced 2024-11-24 09:24:58 +00:00
Checkstyle
This commit is contained in:
parent
c82ab689d4
commit
40cc52d2a3
@ -249,12 +249,8 @@ public final class TrainManager {
|
||||
*/
|
||||
private List<Set<Train>> getCollisionsOfOneReverseStep() {
|
||||
List<Set<Train>> collisions = new ArrayList<>();
|
||||
Map<Train, Set<Rail>> occupiedRails = new HashMap<>();
|
||||
for (Train train : trains.values()) {
|
||||
if (train.isPlaced()) {
|
||||
occupiedRails.put(train, train.getOccupiedRails());
|
||||
}
|
||||
}
|
||||
Map<Train, Set<Rail>> occupiedRails = trains.values().stream().filter(Train::isPlaced)
|
||||
.collect(Collectors.toMap(Function.identity(), Train::getOccupiedRails));
|
||||
// perform step
|
||||
Map<Train, Set<Rail>> nextOccupiedRails = new HashMap<>();
|
||||
trains.values().stream().filter(Train::isPlaced).forEach(train -> {
|
||||
|
Loading…
Reference in New Issue
Block a user