diff options
Diffstat (limited to 'src/ch/epfl/xblast/server/Bomb.java')
-rw-r--r-- | src/ch/epfl/xblast/server/Bomb.java | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/ch/epfl/xblast/server/Bomb.java b/src/ch/epfl/xblast/server/Bomb.java index 78de111..535573f 100644 --- a/src/ch/epfl/xblast/server/Bomb.java +++ b/src/ch/epfl/xblast/server/Bomb.java | |||
@@ -20,11 +20,31 @@ import java.util.stream.Stream; | |||
20 | */ | 20 | */ |
21 | public final class Bomb { | 21 | public final class Bomb { |
22 | 22 | ||
23 | /** | ||
24 | * Function consuming a step of the Bomb's fuse. | ||
25 | */ | ||
23 | private static final UnaryOperator<Integer> FUSE_STEP_FUNCTION = fl -> fl - 1; | 26 | private static final UnaryOperator<Integer> FUSE_STEP_FUNCTION = fl -> fl - 1; |
27 | |||
28 | /** | ||
29 | * Owner of the Bomb. | ||
30 | */ | ||
24 | private PlayerID ownerId; | 31 | private PlayerID ownerId; |
32 | |||
33 | /** | ||
34 | * Position of the Bomb. | ||
35 | */ | ||
25 | private Cell position; | 36 | private Cell position; |
37 | |||
38 | /** | ||
39 | * Fuse of the Bomb. | ||
40 | */ | ||
26 | private Sq<Integer> fuseLengths; | 41 | private Sq<Integer> fuseLengths; |
42 | |||
43 | /** | ||
44 | * Range of the Bomb. | ||
45 | */ | ||
27 | private int range; | 46 | private int range; |
47 | |||
28 | /** | 48 | /** |
29 | * Instantiates a new Bomb. | 49 | * Instantiates a new Bomb. |
30 | * | 50 | * |
@@ -69,6 +89,8 @@ public final class Bomb { | |||
69 | 89 | ||
70 | /** | 90 | /** |
71 | * Generates one arm of explosion. | 91 | * Generates one arm of explosion. |
92 | * | ||
93 | * @param dir the Direction of the arm | ||
72 | */ | 94 | */ |
73 | private Sq<Sq<Cell>> explosionArmTowards(Direction dir) { | 95 | private Sq<Sq<Cell>> explosionArmTowards(Direction dir) { |
74 | return Sq | 96 | return Sq |
@@ -132,6 +154,11 @@ public final class Bomb { | |||
132 | .collect(Collectors.toList()); | 154 | .collect(Collectors.toList()); |
133 | } | 155 | } |
134 | 156 | ||
157 | /** | ||
158 | * Returns a String representation of the parameters of the Bomb. | ||
159 | * | ||
160 | * @return a String representation of the parameters of the Bomb. | ||
161 | */ | ||
135 | @Override | 162 | @Override |
136 | public String toString() { | 163 | public String toString() { |
137 | return "Bomb{" + | 164 | return "Bomb{" + |