diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ch/epfl/xblast/server/GameState.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/ch/epfl/xblast/server/GameState.java b/src/ch/epfl/xblast/server/GameState.java index 2c6f372..cbe29b5 100644 --- a/src/ch/epfl/xblast/server/GameState.java +++ b/src/ch/epfl/xblast/server/GameState.java | |||
@@ -7,6 +7,7 @@ import ch.epfl.xblast.Direction; | |||
7 | import ch.epfl.xblast.PlayerID; | 7 | import ch.epfl.xblast.PlayerID; |
8 | 8 | ||
9 | import java.util.*; | 9 | import java.util.*; |
10 | import java.util.function.Function; | ||
10 | import java.util.stream.Collectors; | 11 | import java.util.stream.Collectors; |
11 | import java.util.stream.Stream; | 12 | import java.util.stream.Stream; |
12 | 13 | ||
@@ -205,7 +206,9 @@ public final class GameState { | |||
205 | * @return the map of bombs | 206 | * @return the map of bombs |
206 | */ | 207 | */ |
207 | public Map<Cell, Bomb> bombedCells() { | 208 | public Map<Cell, Bomb> bombedCells() { |
208 | return null; // TODO | 209 | return this.bombs |
210 | .stream() | ||
211 | .collect(Collectors.toMap(Bomb::position, Function.identity())); | ||
209 | } | 212 | } |
210 | 213 | ||
211 | /** | 214 | /** |
@@ -214,7 +217,10 @@ public final class GameState { | |||
214 | * @return the set of blasted cells | 217 | * @return the set of blasted cells |
215 | */ | 218 | */ |
216 | public Set<Cell> blastedCells() { | 219 | public Set<Cell> blastedCells() { |
217 | return null; // TODO | 220 | return this.blasts |
221 | .stream() | ||
222 | .map(Sq::head) | ||
223 | .collect(Collectors.toSet()); | ||
218 | } | 224 | } |
219 | 225 | ||
220 | /** | 226 | /** |