From 089af244870bd45fa55ad782e71403d98eed2c6a Mon Sep 17 00:00:00 2001 From: Timothée Floure Date: Sun, 8 May 2016 14:25:15 +0200 Subject: Fix the scores "line" generation in GameStateDeserializer --- src/ch/epfl/xblast/client/GameStateDeserializer.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ch/epfl/xblast/client/GameStateDeserializer.java b/src/ch/epfl/xblast/client/GameStateDeserializer.java index 66be2d9..1fb1c61 100644 --- a/src/ch/epfl/xblast/client/GameStateDeserializer.java +++ b/src/ch/epfl/xblast/client/GameStateDeserializer.java @@ -31,7 +31,11 @@ public final class GameStateDeserializer { private final static int PLAYER_CHUNK_SIZE = 4; private final static int PLAYER_TOTAL_SIZE = NUMBER_OF_PLAYERS * PLAYER_CHUNK_SIZE; + /** + * Various + */ private final static int TIME_LINE_SIZE = (Ticks.GAME_DURATION / 2); + private final static int SCORE_SEPARATION_SIZE = 8; /** * Images ID @@ -103,7 +107,14 @@ public final class GameStateDeserializer { List scores = new ArrayList<>(); ImageCollection imageCollection = new ImageCollection(SCORE_IMAGES_FOLDER); - scores.addAll(buildPlayerScore(players.get(0), imageCollection)); + scores.addAll(buildPlayerScore(players.get(0), imageCollection)); // PLAYER_1 + scores.addAll(buildPlayerScore(players.get(1), imageCollection)); // PLAYER_2 + + // Separation tiles + for (int i = 0; i < SCORE_SEPARATION_SIZE; i++){ scores.add(imageCollection.imageOrNull(SCORE_TILE_VOID_IMAGE_ID)); } + + scores.addAll(buildPlayerScore(players.get(2), imageCollection)); // PLAYER_3 + scores.addAll(buildPlayerScore(players.get(3), imageCollection)); // PLAYER_4 return scores; } -- cgit v1.2.3