aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/fr/umlv/java/wallj/context/Stage.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/fr/umlv/java/wallj/context/Stage.java')
-rw-r--r--src/main/java/fr/umlv/java/wallj/context/Stage.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/main/java/fr/umlv/java/wallj/context/Stage.java b/src/main/java/fr/umlv/java/wallj/context/Stage.java
index 9b66e03..903b5de 100644
--- a/src/main/java/fr/umlv/java/wallj/context/Stage.java
+++ b/src/main/java/fr/umlv/java/wallj/context/Stage.java
@@ -36,6 +36,14 @@ public class Stage implements Updateable {
36 blocks.forEach(block -> block.link(world)); 36 blocks.forEach(block -> block.link(world));
37 } 37 }
38 38
39 private static TileVec2 findAnyFreeTile(Board board) {
40 return board.stream()
41 .filter(entry -> entry.getValue() == BlockType.FREE)
42 .findAny()
43 .map(Map.Entry::getKey)
44 .orElseThrow(IllegalArgumentException::new);
45 }
46
39 /** 47 /**
40 * @return the JBox2D world 48 * @return the JBox2D world
41 */ 49 */
@@ -126,12 +134,4 @@ public class Stage implements Updateable {
126 .filter(block -> block.getType() == BlockType.BOMB) 134 .filter(block -> block.getType() == BlockType.BOMB)
127 .count() == BOMB_PLACEMENTS; 135 .count() == BOMB_PLACEMENTS;
128 } 136 }
129
130 private static TileVec2 findAnyFreeTile(Board board) {
131 return board.stream()
132 .filter(entry -> entry.getValue() == BlockType.FREE)
133 .findAny()
134 .map(Map.Entry::getKey)
135 .orElseThrow(IllegalArgumentException::new);
136 }
137} 137}