aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPacien TRAN-GIRARD2016-04-08 13:25:41 +0200
committerPacien TRAN-GIRARD2016-04-08 13:25:41 +0200
commit68c4263fa48cf211b17b07dd74ba2bb5c827ef73 (patch)
treeabc037da1a98c404567d6a65f603270e11f0f480 /src
parentba298420d7890412c42b671e387602c3fc240730 (diff)
parent936267c0e4cd775c13cb72cc3df5c0e8f6765284 (diff)
downloadxblast-68c4263fa48cf211b17b07dd74ba2bb5c827ef73.tar.gz
Make nextBlasts great again
Diffstat (limited to 'src')
-rw-r--r--src/ch/epfl/xblast/server/GameState.java8
-rw-r--r--src/ch/epfl/xblast/server/Ticks.java1
2 files changed, 5 insertions, 4 deletions
diff --git a/src/ch/epfl/xblast/server/GameState.java b/src/ch/epfl/xblast/server/GameState.java
index 288aeb8..e75da1d 100644
--- a/src/ch/epfl/xblast/server/GameState.java
+++ b/src/ch/epfl/xblast/server/GameState.java
@@ -103,11 +103,13 @@ public final class GameState {
103 private static List<Sq<Cell>> nextBlasts(List<Sq<Cell>> blasts0, Board board0, List<Sq<Sq<Cell>>> explosions0) { 103 private static List<Sq<Cell>> nextBlasts(List<Sq<Cell>> blasts0, Board board0, List<Sq<Sq<Cell>>> explosions0) {
104 return Stream.concat( 104 return Stream.concat(
105 blasts0.stream() 105 blasts0.stream()
106 .filter(blastSeq -> !blastSeq.tail().isEmpty()) 106 .filter(b -> !b.tail().isEmpty())
107 .filter(blastSeq -> board0.blockAt(blastSeq.head()).isFree()) 107 .filter(b -> board0.blockAt(b.head()).isFree())
108 .map(Sq::tail), 108 .map(Sq::tail),
109 explosions0.stream() 109 explosions0.stream()
110 .map(Sq::head)) 110 .filter(e -> !e.isEmpty())
111 .map(Sq::head)
112 .filter(b -> !b.isEmpty()))
111 .collect(Collectors.toList()); 113 .collect(Collectors.toList());
112 } 114 }
113 115
diff --git a/src/ch/epfl/xblast/server/Ticks.java b/src/ch/epfl/xblast/server/Ticks.java
index b880dd7..a4c3e74 100644
--- a/src/ch/epfl/xblast/server/Ticks.java
+++ b/src/ch/epfl/xblast/server/Ticks.java
@@ -34,7 +34,6 @@ public interface Ticks {
34 * Duration of crumbling of a wall (in ticks). 34 * Duration of crumbling of a wall (in ticks).
35 */ 35 */
36 int WALL_CRUMBLING_TICKS = EXPLOSION_TICKS; 36 int WALL_CRUMBLING_TICKS = EXPLOSION_TICKS;
37
38 /** 37 /**
39 * Duration of the presence of a bonus (in ticks). 38 * Duration of the presence of a bonus (in ticks).
40 */ 39 */