aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ch/epfl/xblast/client/GameStateDeserializer.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ch/epfl/xblast/client/GameStateDeserializer.java b/src/ch/epfl/xblast/client/GameStateDeserializer.java
index 2c06dbc..e2039ed 100644
--- a/src/ch/epfl/xblast/client/GameStateDeserializer.java
+++ b/src/ch/epfl/xblast/client/GameStateDeserializer.java
@@ -108,10 +108,10 @@ public final class GameStateDeserializer {
108 * @return a list of Images corresponding to the serialized element 108 * @return a list of Images corresponding to the serialized element
109 */ 109 */
110 private static List<Image> deserializeImageChunk(List<Byte> data, ImageCollection imageCollection) { 110 private static List<Image> deserializeImageChunk(List<Byte> data, ImageCollection imageCollection) {
111 return RunLengthEncoder.decode(data).stream() 111 return Collections.unmodifiableList(RunLengthEncoder.decode(data).stream()
112 .map(Byte::toUnsignedInt) 112 .map(Byte::toUnsignedInt)
113 .map(imageCollection::imageOrNull) 113 .map(imageCollection::imageOrNull)
114 .collect(Collectors.toList()); 114 .collect(Collectors.toList()));
115 } 115 }
116 116
117 /** 117 /**
@@ -131,9 +131,9 @@ public final class GameStateDeserializer {
131 .range(0, Cell.SPIRAL_ORDER.size()).mapToObj(i -> i) 131 .range(0, Cell.SPIRAL_ORDER.size()).mapToObj(i -> i)
132 .collect(Collectors.toMap(Cell.SPIRAL_ORDER::get, spiralOrdered::get)); 132 .collect(Collectors.toMap(Cell.SPIRAL_ORDER::get, spiralOrdered::get));
133 133
134 return Cell.ROW_MAJOR_ORDER.stream() 134 return Collections.unmodifiableList(Cell.ROW_MAJOR_ORDER.stream()
135 .map(imageMap::get) 135 .map(imageMap::get)
136 .collect(Collectors.toList()); 136 .collect(Collectors.toList()));
137 } 137 }
138 138
139 /** 139 /**