diff options
author | Pacien TRAN-GIRARD | 2016-03-15 20:02:13 +0100 |
---|---|---|
committer | Pacien TRAN-GIRARD | 2016-03-15 20:02:13 +0100 |
commit | fab4253bba72b035fe36124d66d10799b224b6cf (patch) | |
tree | 677c8ced3bd953b344e59c664069b5823cc8c4d7 | |
parent | c6adb037f5a3d4edd1b8038113b37e35f2161555 (diff) | |
download | xblast-fab4253bba72b035fe36124d66d10799b224b6cf.tar.gz |
Reorder methods and rename parameters according to instructions
-rw-r--r-- | src/ch/epfl/xblast/server/GameState.java | 130 |
1 files changed, 65 insertions, 65 deletions
diff --git a/src/ch/epfl/xblast/server/GameState.java b/src/ch/epfl/xblast/server/GameState.java index fd4b917..2c6f372 100644 --- a/src/ch/epfl/xblast/server/GameState.java +++ b/src/ch/epfl/xblast/server/GameState.java | |||
@@ -28,23 +28,81 @@ public final class GameState { | |||
28 | /** | 28 | /** |
29 | * Compute the next state of a blast. | 29 | * Compute the next state of a blast. |
30 | * | 30 | * |
31 | * @param blasts existing particles | 31 | * @param blasts0 existing particles |
32 | * @param board the game's board | 32 | * @param board0 the game's board |
33 | * @param explosions active explosions | 33 | * @param explosions0 active explosions |
34 | * @return the position of the explosion's particles for the next state. | 34 | * @return the position of the explosion's particles for the next state. |
35 | */ | 35 | */ |
36 | private static List<Sq<Cell>> nextBlasts(List<Sq<Cell>> blasts, Board board, List<Sq<Sq<Cell>>> explosions) { | 36 | private static List<Sq<Cell>> nextBlasts(List<Sq<Cell>> blasts0, Board board0, List<Sq<Sq<Cell>>> explosions0) { |
37 | return Stream.concat( | 37 | return Stream.concat( |
38 | blasts.stream() | 38 | blasts0.stream() |
39 | .filter(blastSeq -> !blastSeq.tail().isEmpty()) | 39 | .filter(blastSeq -> !blastSeq.tail().isEmpty()) |
40 | .filter(blastSeq -> board.blockAt(blastSeq.head()).isFree()) | 40 | .filter(blastSeq -> board0.blockAt(blastSeq.head()).isFree()) |
41 | .map(Sq::tail), | 41 | .map(Sq::tail), |
42 | explosions.stream() | 42 | explosions0.stream() |
43 | .map(Sq::head) | 43 | .map(Sq::head) |
44 | ).collect(Collectors.toList()); | 44 | ).collect(Collectors.toList()); |
45 | } | 45 | } |
46 | 46 | ||
47 | /** | 47 | /** |
48 | * Computes and returns the next board state of the given board according to the given events. | ||
49 | * | ||
50 | * @param board0 the previous board | ||
51 | * @param consumedBonuses the set of consumed bonuses | ||
52 | * @param blastedCells1 the set of newly blasted cells | ||
53 | * @return the next board | ||
54 | */ | ||
55 | private static Board nextBoard(Board board0, Set<Cell> consumedBonuses, Set<Cell> blastedCells1) { | ||
56 | return null; // TODO | ||
57 | } | ||
58 | |||
59 | /** | ||
60 | * Computes and returns the next player list given the current one and the given events and states. | ||
61 | * | ||
62 | * @param players0 the previous player list | ||
63 | * @param playerBonuses the map of player bonuses | ||
64 | * @param bombedCells1 the set of newly bombed cells | ||
65 | * @param board1 the newly updated board | ||
66 | * @param blastedCells1 the set of newly blasted cells | ||
67 | * @param speedChangeEvents the speed change events | ||
68 | * @return the next player list | ||
69 | */ | ||
70 | private static List<Player> nextPlayers( | ||
71 | List<Player> players0, | ||
72 | Map<PlayerID, Bonus> playerBonuses, | ||
73 | Set<Cell> bombedCells1, | ||
74 | Board board1, | ||
75 | Set<Cell> blastedCells1, | ||
76 | Map<PlayerID, Optional<Direction>> speedChangeEvents) { | ||
77 | return null; // TODO | ||
78 | } | ||
79 | |||
80 | /** | ||
81 | * Computes and returns the next state of the given explosion list. | ||
82 | * | ||
83 | * @param explosions0 the previous explosion state | ||
84 | * @return the next explosion state | ||
85 | */ | ||
86 | private static List<Sq<Sq<Cell>>> nextExplosions(List<Sq<Sq<Cell>>> explosions0) { | ||
87 | return null; // TODO | ||
88 | } | ||
89 | |||
90 | /** | ||
91 | * Computes and returns the list of newly dropped bombs by players according to the given player states and events. | ||
92 | * | ||
93 | * @param players0 the previous player states | ||
94 | * @param bombDropEvents the bomb drop events | ||
95 | * @param bombs0 the previous bomb state | ||
96 | * @return the newly dropped bombs | ||
97 | */ | ||
98 | private static List<Bomb> newlyDroppedBombs( | ||
99 | List<Player> players0, | ||
100 | Set<PlayerID> bombDropEvents, | ||
101 | List<Bomb> bombs0) { | ||
102 | return null; // TODO | ||
103 | } | ||
104 | |||
105 | /** | ||
48 | * Instantiates a new GameState. | 106 | * Instantiates a new GameState. |
49 | * | 107 | * |
50 | * @param ticks the tick corresponding to the state | 108 | * @param ticks the tick corresponding to the state |
@@ -170,62 +228,4 @@ public final class GameState { | |||
170 | return null; // TODO | 228 | return null; // TODO |
171 | } | 229 | } |
172 | 230 | ||
173 | /** | ||
174 | * Computes and returns the next board state of the given board according to the given events. | ||
175 | * | ||
176 | * @param board0 the previous board | ||
177 | * @param consumedBonuses the set of consumed bonuses | ||
178 | * @param blastedCells1 the set of newly blasted cells | ||
179 | * @return the next board | ||
180 | */ | ||
181 | private static Board nextBoard(Board board0, Set<Cell> consumedBonuses, Set<Cell> blastedCells1) { | ||
182 | return null; // TODO | ||
183 | } | ||
184 | |||
185 | /** | ||
186 | * Computes and returns the next player list given the current one and the given events and states. | ||
187 | * | ||
188 | * @param players0 the previous player list | ||
189 | * @param playerBonuses the map of player bonuses | ||
190 | * @param bombedCells1 the set of newly bombed cells | ||
191 | * @param board1 the newly updated board | ||
192 | * @param blastedCells1 the set of newly blasted cells | ||
193 | * @param speedChangeEvents the speed change events | ||
194 | * @return the next player list | ||
195 | */ | ||
196 | private static List<Player> nextPlayers( | ||
197 | List<Player> players0, | ||
198 | Map<PlayerID, Bonus> playerBonuses, | ||
199 | Set<Cell> bombedCells1, | ||
200 | Board board1, | ||
201 | Set<Cell> blastedCells1, | ||
202 | Map<PlayerID, Optional<Direction>> speedChangeEvents) { | ||
203 | return null; // TODO | ||
204 | } | ||
205 | |||
206 | /** | ||
207 | * Computes and returns the next state of the given explosion list. | ||
208 | * | ||
209 | * @param explosions0 the previous explosion state | ||
210 | * @return the next explosion state | ||
211 | */ | ||
212 | private static List<Sq<Sq<Cell>>> nextExplosions(List<Sq<Sq<Cell>>> explosions0) { | ||
213 | return null; // TODO | ||
214 | } | ||
215 | |||
216 | /** | ||
217 | * Computes and returns the list of newly dropped bombs by players according to the given player states and events. | ||
218 | * | ||
219 | * @param players0 the previous player states | ||
220 | * @param bombDropEvents the bomb drop events | ||
221 | * @param bombs0 the previous bomb state | ||
222 | * @return the newly dropped bombs | ||
223 | */ | ||
224 | private static List<Bomb> newlyDroppedBombs( | ||
225 | List<Player> players0, | ||
226 | Set<PlayerID> bombDropEvents, | ||
227 | List<Bomb> bombs0) { | ||
228 | return null; // TODO | ||
229 | } | ||
230 | |||
231 | } | 231 | } |