From 7309447c8ddc269eaa014dcb9c2f62716053b632 Mon Sep 17 00:00:00 2001 From: Pacien TRAN-GIRARD Date: Thu, 31 Mar 2016 13:35:36 +0200 Subject: Fix wrong method call for empty set enum creation --- src/ch/epfl/xblast/server/GameState.java | 13 +++++++------ 1 file 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 { * @return the conflict-free set of bomb drop events */ private Set discardConflictingBombDropEvents(Set bombDropEvents) { - return EnumSet.copyOf( - this.mapTopPriorityPlayerCells( - this.alivePlayers().stream() - .filter(bombDropEvents::contains) - .collect(Collectors.toList()) - ).values()); + Map bombDropMap = this.mapTopPriorityPlayerCells( + this.alivePlayers().stream() + .filter(bombDropEvents::contains) + .collect(Collectors.toList()) + ); + + return bombDropMap.isEmpty() ? EnumSet.noneOf(PlayerID.class) : EnumSet.copyOf(bombDropMap.values()); } /** -- cgit v1.2.3