From be399f170a086000ffa774c9dcfb9a5eb6233ab2 Mon Sep 17 00:00:00 2001 From: Pacien TRAN-GIRARD Date: Mon, 7 Mar 2016 16:28:51 +0100 Subject: Fix Bomb secondary constructor for decreasing fuse lengths sequences --- src/ch/epfl/xblast/server/Bomb.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src') 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; import java.util.ArrayList; /** + * @author Pacien TRAN-GIRARD (261948) * @author Timothée FLOURE (257420) */ public final class Bomb { @@ -58,12 +59,7 @@ public final class Bomb { * @throws NullPointerException if ownerId, position or fuseLengths is null */ public Bomb(PlayerID ownerId, Cell position, int fuseLength, int range) { - if (fuseLength == 0) { - throw new IllegalArgumentException(); - } else { - fuseLengths = Sq.iterate(fuseLength, fuseLengths -> fuseLength - 1 ); - } - this.Bomb(ownerId, position, fuseLengths, range); + this(ownerId, position, Sq.iterate(fuseLength, fl -> fl - 1 ), range); } /** -- cgit v1.2.3