diff options
Diffstat (limited to 'src/ch')
-rw-r--r-- | src/ch/epfl/xblast/server/GameState.java | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/ch/epfl/xblast/server/GameState.java b/src/ch/epfl/xblast/server/GameState.java index 32edf5d..f4d021c 100644 --- a/src/ch/epfl/xblast/server/GameState.java +++ b/src/ch/epfl/xblast/server/GameState.java | |||
@@ -456,12 +456,13 @@ public final class GameState { | |||
456 | * @return the conflict-free set of bomb drop events | 456 | * @return the conflict-free set of bomb drop events |
457 | */ | 457 | */ |
458 | private Set<PlayerID> discardConflictingBombDropEvents(Set<PlayerID> bombDropEvents) { | 458 | private Set<PlayerID> discardConflictingBombDropEvents(Set<PlayerID> bombDropEvents) { |
459 | return EnumSet.copyOf( | 459 | Map<Cell, PlayerID> bombDropMap = this.mapTopPriorityPlayerCells( |
460 | this.mapTopPriorityPlayerCells( | 460 | this.alivePlayers().stream() |
461 | this.alivePlayers().stream() | 461 | .filter(bombDropEvents::contains) |
462 | .filter(bombDropEvents::contains) | 462 | .collect(Collectors.toList()) |
463 | .collect(Collectors.toList()) | 463 | ); |
464 | ).values()); | 464 | |
465 | return bombDropMap.isEmpty() ? EnumSet.noneOf(PlayerID.class) : EnumSet.copyOf(bombDropMap.values()); | ||
465 | } | 466 | } |
466 | 467 | ||
467 | /** | 468 | /** |