diff options
Diffstat (limited to 'src/ch')
-rw-r--r-- | src/ch/epfl/xblast/server/GameState.java | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/ch/epfl/xblast/server/GameState.java b/src/ch/epfl/xblast/server/GameState.java index 22fe233..702fa37 100644 --- a/src/ch/epfl/xblast/server/GameState.java +++ b/src/ch/epfl/xblast/server/GameState.java | |||
@@ -283,8 +283,7 @@ public final class GameState { | |||
283 | * @return the truncated path | 283 | * @return the truncated path |
284 | */ | 284 | */ |
285 | private static Sq<Player.DirectedPosition> pathToNextCentralPosition(Sq<Player.DirectedPosition> p) { | 285 | private static Sq<Player.DirectedPosition> pathToNextCentralPosition(Sq<Player.DirectedPosition> p) { |
286 | return p.tail() | 286 | return p.takeWhile(dp -> !dp.position().isCentral()); |
287 | .takeWhile(dp -> dp.position().isCentral()); | ||
288 | } | 287 | } |
289 | 288 | ||
290 | /** | 289 | /** |
@@ -294,9 +293,7 @@ public final class GameState { | |||
294 | * @return the next central SubCell | 293 | * @return the next central SubCell |
295 | */ | 294 | */ |
296 | private static SubCell nextCentralPosition(Sq<Player.DirectedPosition> p) { | 295 | private static SubCell nextCentralPosition(Sq<Player.DirectedPosition> p) { |
297 | return p.tail() | 296 | return p.findFirst(dp -> dp.position().isCentral()).position(); |
298 | .findFirst(dp -> dp.position().isCentral()) | ||
299 | .position(); | ||
300 | } | 297 | } |
301 | 298 | ||
302 | /** | 299 | /** |