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() {
|
private List<Set<Train>> getCollisionsOfOneReverseStep() {
|
||||||
List<Set<Train>> collisions = new ArrayList<>();
|
List<Set<Train>> collisions = new ArrayList<>();
|
||||||
Map<Train, Set<Rail>> occupiedRails = new HashMap<>();
|
Map<Train, Set<Rail>> occupiedRails = trains.values().stream().filter(Train::isPlaced)
|
||||||
for (Train train : trains.values()) {
|
.collect(Collectors.toMap(Function.identity(), Train::getOccupiedRails));
|
||||||
if (train.isPlaced()) {
|
|
||||||
occupiedRails.put(train, train.getOccupiedRails());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// perform step
|
// perform step
|
||||||
Map<Train, Set<Rail>> nextOccupiedRails = new HashMap<>();
|
Map<Train, Set<Rail>> nextOccupiedRails = new HashMap<>();
|
||||||
trains.values().stream().filter(Train::isPlaced).forEach(train -> {
|
trains.values().stream().filter(Train::isPlaced).forEach(train -> {
|
||||||
|
Loading…
Reference in New Issue
Block a user