aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothée Floure2016-05-08 14:25:15 +0200
committerTimothée Floure2016-05-08 14:25:15 +0200
commit089af244870bd45fa55ad782e71403d98eed2c6a (patch)
tree7a03c72da4f47dcb5ae8cd40aba3a20acb7e0420
parent03a6be12726147c494e145b543230ecbf64905e7 (diff)
downloadxblast-089af244870bd45fa55ad782e71403d98eed2c6a.tar.gz
Fix the scores "line" generation in GameStateDeserializer
-rw-r--r--src/ch/epfl/xblast/client/GameStateDeserializer.java13
1 files changed, 12 insertions, 1 deletions
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 {
31 private final static int PLAYER_CHUNK_SIZE = 4; 31 private final static int PLAYER_CHUNK_SIZE = 4;
32 private final static int PLAYER_TOTAL_SIZE = NUMBER_OF_PLAYERS * PLAYER_CHUNK_SIZE; 32 private final static int PLAYER_TOTAL_SIZE = NUMBER_OF_PLAYERS * PLAYER_CHUNK_SIZE;
33 33
34 /**
35 * Various
36 */
34 private final static int TIME_LINE_SIZE = (Ticks.GAME_DURATION / 2); 37 private final static int TIME_LINE_SIZE = (Ticks.GAME_DURATION / 2);
38 private final static int SCORE_SEPARATION_SIZE = 8;
35 39
36 /** 40 /**
37 * Images ID 41 * Images ID
@@ -103,7 +107,14 @@ public final class GameStateDeserializer {
103 List<Image> scores = new ArrayList<>(); 107 List<Image> scores = new ArrayList<>();
104 ImageCollection imageCollection = new ImageCollection(SCORE_IMAGES_FOLDER); 108 ImageCollection imageCollection = new ImageCollection(SCORE_IMAGES_FOLDER);
105 109
106 scores.addAll(buildPlayerScore(players.get(0), imageCollection)); 110 scores.addAll(buildPlayerScore(players.get(0), imageCollection)); // PLAYER_1
111 scores.addAll(buildPlayerScore(players.get(1), imageCollection)); // PLAYER_2
112
113 // Separation tiles
114 for (int i = 0; i < SCORE_SEPARATION_SIZE; i++){ scores.add(imageCollection.imageOrNull(SCORE_TILE_VOID_IMAGE_ID)); }
115
116 scores.addAll(buildPlayerScore(players.get(2), imageCollection)); // PLAYER_3
117 scores.addAll(buildPlayerScore(players.get(3), imageCollection)); // PLAYER_4
107 118
108 return scores; 119 return scores;
109 } 120 }