diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ch/epfl/xblast/server/Bomb.java | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/ch/epfl/xblast/server/Bomb.java b/src/ch/epfl/xblast/server/Bomb.java index 38bd4c5..889dde0 100644 --- a/src/ch/epfl/xblast/server/Bomb.java +++ b/src/ch/epfl/xblast/server/Bomb.java | |||
@@ -11,6 +11,7 @@ import java.util.List; | |||
11 | import java.util.ArrayList; | 11 | import java.util.ArrayList; |
12 | 12 | ||
13 | /** | 13 | /** |
14 | * @author Pacien TRAN-GIRARD (261948) | ||
14 | * @author Timothée FLOURE (257420) | 15 | * @author Timothée FLOURE (257420) |
15 | */ | 16 | */ |
16 | public final class Bomb { | 17 | public final class Bomb { |
@@ -58,12 +59,7 @@ public final class Bomb { | |||
58 | * @throws NullPointerException if ownerId, position or fuseLengths is null | 59 | * @throws NullPointerException if ownerId, position or fuseLengths is null |
59 | */ | 60 | */ |
60 | public Bomb(PlayerID ownerId, Cell position, int fuseLength, int range) { | 61 | public Bomb(PlayerID ownerId, Cell position, int fuseLength, int range) { |
61 | if (fuseLength == 0) { | 62 | this(ownerId, position, Sq.iterate(fuseLength, fl -> fl - 1 ), range); |
62 | throw new IllegalArgumentException(); | ||
63 | } else { | ||
64 | fuseLengths = Sq.iterate(fuseLength, fuseLengths -> fuseLength - 1 ); | ||
65 | } | ||
66 | this.Bomb(ownerId, position, fuseLengths, range); | ||
67 | } | 63 | } |
68 | 64 | ||
69 | /** | 65 | /** |