diff options
author | Pacien TRAN-GIRARD | 2016-03-31 13:35:36 +0200 |
---|---|---|
committer | Pacien TRAN-GIRARD | 2016-03-31 13:35:36 +0200 |
commit | 7309447c8ddc269eaa014dcb9c2f62716053b632 (patch) | |
tree | 8c90828997e987864b66b04db20d374d1b55ec31 /src | |
parent | 54cd144e8a070e4b89baa86361db95280939d001 (diff) | |
download | xblast-7309447c8ddc269eaa014dcb9c2f62716053b632.tar.gz |
Fix wrong method call for empty set enum creation
Diffstat (limited to 'src')
-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 | /** |