diff options
Diffstat (limited to 'src/ch/epfl')
-rw-r--r-- | src/ch/epfl/xblast/client/GameStateDeserializer.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/ch/epfl/xblast/client/GameStateDeserializer.java b/src/ch/epfl/xblast/client/GameStateDeserializer.java index e2039ed..8b203b1 100644 --- a/src/ch/epfl/xblast/client/GameStateDeserializer.java +++ b/src/ch/epfl/xblast/client/GameStateDeserializer.java | |||
@@ -141,9 +141,15 @@ public final class GameStateDeserializer { | |||
141 | * | 141 | * |
142 | * @param serializedExplosions the run-length-compressed, serialized explosions | 142 | * @param serializedExplosions the run-length-compressed, serialized explosions |
143 | * @return the explosions | 143 | * @return the explosions |
144 | * @throws IllegalArgumentException if the length of the serialized explosions is invalid | ||
144 | */ | 145 | */ |
145 | private static List<Image> deserializeExplosions(List<Byte> serializedExplosions) { | 146 | private static List<Image> deserializeExplosions(List<Byte> serializedExplosions) { |
146 | return deserializeImageChunk(serializedExplosions, ImageCollection.EXPLOSIONS_IMAGES); | 147 | List<Image> explosions = deserializeImageChunk(serializedExplosions, ImageCollection.EXPLOSIONS_IMAGES); |
148 | |||
149 | if (explosions.size() != Cell.ROW_MAJOR_ORDER.size()) | ||
150 | throw new IllegalArgumentException(); | ||
151 | |||
152 | return explosions; | ||
147 | } | 153 | } |
148 | 154 | ||
149 | /** | 155 | /** |