aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ch/epfl/xblast/server/Bomb.java11
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;
6import ch.epfl.xblast.Direction; 6import ch.epfl.xblast.Direction;
7import ch.epfl.xblast.PlayerID; 7import ch.epfl.xblast.PlayerID;
8 8
9import java.util.ArrayList;
10import java.util.List; 9import java.util.List;
11import java.util.Objects; 10import java.util.Objects;
11import java.util.stream.Collectors;
12import 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}