diff options
Diffstat (limited to 'src/ch')
-rw-r--r-- | src/ch/epfl/xblast/server/Bomb.java | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/ch/epfl/xblast/server/Bomb.java b/src/ch/epfl/xblast/server/Bomb.java index 3b1203b..f32960f 100644 --- a/src/ch/epfl/xblast/server/Bomb.java +++ b/src/ch/epfl/xblast/server/Bomb.java | |||
@@ -6,9 +6,10 @@ import ch.epfl.xblast.Cell; | |||
6 | import ch.epfl.xblast.Direction; | 6 | import ch.epfl.xblast.Direction; |
7 | import ch.epfl.xblast.PlayerID; | 7 | import ch.epfl.xblast.PlayerID; |
8 | 8 | ||
9 | import java.util.ArrayList; | ||
10 | import java.util.List; | 9 | import java.util.List; |
11 | import java.util.Objects; | 10 | import java.util.Objects; |
11 | import java.util.stream.Collectors; | ||
12 | import java.util.stream.Stream; | ||
12 | 13 | ||
13 | /** | 14 | /** |
14 | * A Bomb. | 15 | * A Bomb. |
@@ -106,11 +107,9 @@ public final class Bomb { | |||
106 | * @return the explosion | 107 | * @return the explosion |
107 | */ | 108 | */ |
108 | public List<Sq<Sq<Cell>>> explosion() { | 109 | public List<Sq<Sq<Cell>>> explosion() { |
109 | List<Sq<Sq<Cell>>> explosion = new ArrayList<>(); | 110 | return Stream.of(Direction.values()) |
110 | for (Direction dir : Direction.values()) { | 111 | .map(this::explosionArmTowards) |
111 | explosion.add(this.explosionArmTowards(dir)); | 112 | .collect(Collectors.toList()); |
112 | } | ||
113 | return explosion; | ||
114 | } | 113 | } |
115 | 114 | ||
116 | } | 115 | } |