diff options
author | Pacien TRAN-GIRARD | 2016-04-09 23:25:33 +0200 |
---|---|---|
committer | Pacien TRAN-GIRARD | 2016-04-09 23:25:33 +0200 |
commit | b91369a41a605c5b941479c43aa6fc1221e78067 (patch) | |
tree | ed88eb6cc5f06332d0742f677211576f08a7b87c | |
parent | 8a0e6731a5f163423da00b34d86a85d3d172624c (diff) | |
download | xblast-b91369a41a605c5b941479c43aa6fc1221e78067.tar.gz |
Fix mutable lists encapsulation failure
-rw-r--r-- | src/ch/epfl/xblast/server/GameState.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ch/epfl/xblast/server/GameState.java b/src/ch/epfl/xblast/server/GameState.java index 6ff0ded..8a9d5a9 100644 --- a/src/ch/epfl/xblast/server/GameState.java +++ b/src/ch/epfl/xblast/server/GameState.java | |||
@@ -395,11 +395,11 @@ public final class GameState { | |||
395 | this.board = Objects.requireNonNull(board); | 395 | this.board = Objects.requireNonNull(board); |
396 | 396 | ||
397 | if (players.size() != PlayerID.values().length) throw new IllegalArgumentException(); | 397 | if (players.size() != PlayerID.values().length) throw new IllegalArgumentException(); |
398 | this.players = players; | 398 | this.players = new ArrayList<>(players); |
399 | 399 | ||
400 | this.bombs = Objects.requireNonNull(bombs); | 400 | this.bombs = new ArrayList<>(Objects.requireNonNull(bombs)); |
401 | this.explosions = Objects.requireNonNull(explosions); | 401 | this.explosions = new ArrayList<>(Objects.requireNonNull(explosions)); |
402 | this.blasts = Objects.requireNonNull(blasts); | 402 | this.blasts = new ArrayList<>(Objects.requireNonNull(blasts)); |
403 | } | 403 | } |
404 | 404 | ||
405 | /** | 405 | /** |