From fab4253bba72b035fe36124d66d10799b224b6cf Mon Sep 17 00:00:00 2001 From: Pacien TRAN-GIRARD Date: Tue, 15 Mar 2016 20:02:13 +0100 Subject: Reorder methods and rename parameters according to instructions --- src/ch/epfl/xblast/server/GameState.java | 130 +++++++++++++++---------------- 1 file changed, 65 insertions(+), 65 deletions(-) (limited to 'src/ch') 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,22 +28,80 @@ public final class GameState { /** * Compute the next state of a blast. * - * @param blasts existing particles - * @param board the game's board - * @param explosions active explosions + * @param blasts0 existing particles + * @param board0 the game's board + * @param explosions0 active explosions * @return the position of the explosion's particles for the next state. */ - private static List> nextBlasts(List> blasts, Board board, List>> explosions) { + private static List> nextBlasts(List> blasts0, Board board0, List>> explosions0) { return Stream.concat( - blasts.stream() + blasts0.stream() .filter(blastSeq -> !blastSeq.tail().isEmpty()) - .filter(blastSeq -> board.blockAt(blastSeq.head()).isFree()) + .filter(blastSeq -> board0.blockAt(blastSeq.head()).isFree()) .map(Sq::tail), - explosions.stream() + explosions0.stream() .map(Sq::head) ).collect(Collectors.toList()); } + /** + * Computes and returns the next board state of the given board according to the given events. + * + * @param board0 the previous board + * @param consumedBonuses the set of consumed bonuses + * @param blastedCells1 the set of newly blasted cells + * @return the next board + */ + private static Board nextBoard(Board board0, Set consumedBonuses, Set blastedCells1) { + return null; // TODO + } + + /** + * Computes and returns the next player list given the current one and the given events and states. + * + * @param players0 the previous player list + * @param playerBonuses the map of player bonuses + * @param bombedCells1 the set of newly bombed cells + * @param board1 the newly updated board + * @param blastedCells1 the set of newly blasted cells + * @param speedChangeEvents the speed change events + * @return the next player list + */ + private static List nextPlayers( + List players0, + Map playerBonuses, + Set bombedCells1, + Board board1, + Set blastedCells1, + Map> speedChangeEvents) { + return null; // TODO + } + + /** + * Computes and returns the next state of the given explosion list. + * + * @param explosions0 the previous explosion state + * @return the next explosion state + */ + private static List>> nextExplosions(List>> explosions0) { + return null; // TODO + } + + /** + * Computes and returns the list of newly dropped bombs by players according to the given player states and events. + * + * @param players0 the previous player states + * @param bombDropEvents the bomb drop events + * @param bombs0 the previous bomb state + * @return the newly dropped bombs + */ + private static List newlyDroppedBombs( + List players0, + Set bombDropEvents, + List bombs0) { + return null; // TODO + } + /** * Instantiates a new GameState. * @@ -170,62 +228,4 @@ public final class GameState { return null; // TODO } - /** - * Computes and returns the next board state of the given board according to the given events. - * - * @param board0 the previous board - * @param consumedBonuses the set of consumed bonuses - * @param blastedCells1 the set of newly blasted cells - * @return the next board - */ - private static Board nextBoard(Board board0, Set consumedBonuses, Set blastedCells1) { - return null; // TODO - } - - /** - * Computes and returns the next player list given the current one and the given events and states. - * - * @param players0 the previous player list - * @param playerBonuses the map of player bonuses - * @param bombedCells1 the set of newly bombed cells - * @param board1 the newly updated board - * @param blastedCells1 the set of newly blasted cells - * @param speedChangeEvents the speed change events - * @return the next player list - */ - private static List nextPlayers( - List players0, - Map playerBonuses, - Set bombedCells1, - Board board1, - Set blastedCells1, - Map> speedChangeEvents) { - return null; // TODO - } - - /** - * Computes and returns the next state of the given explosion list. - * - * @param explosions0 the previous explosion state - * @return the next explosion state - */ - private static List>> nextExplosions(List>> explosions0) { - return null; // TODO - } - - /** - * Computes and returns the list of newly dropped bombs by players according to the given player states and events. - * - * @param players0 the previous player states - * @param bombDropEvents the bomb drop events - * @param bombs0 the previous bomb state - * @return the newly dropped bombs - */ - private static List newlyDroppedBombs( - List players0, - Set bombDropEvents, - List bombs0) { - return null; // TODO - } - } -- cgit v1.2.3