diff options
Diffstat (limited to 'src/ch')
-rw-r--r-- | src/ch/epfl/xblast/server/Bonus.java | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/ch/epfl/xblast/server/Bonus.java b/src/ch/epfl/xblast/server/Bonus.java index f22c9fe..80ca8a9 100644 --- a/src/ch/epfl/xblast/server/Bonus.java +++ b/src/ch/epfl/xblast/server/Bonus.java | |||
@@ -1,35 +1,36 @@ | |||
1 | package ch.epfl.xblast.server; | 1 | package ch.epfl.xblast.server; |
2 | 2 | ||
3 | /** | 3 | /** |
4 | * @author TimothéE FLOURE (257420) | 4 | * Bonuses. |
5 | * | ||
6 | * @author Pacien TRAN-GIRARD (261948) | ||
7 | * @author Timothée FLOURE (257420) | ||
5 | */ | 8 | */ |
6 | public enum Bonus { | 9 | public enum Bonus { |
7 | 10 | ||
8 | /** | 11 | /** |
9 | * Increase the maximum number of bombs used simultaneously. | 12 | * Increases the maximum number of bombs used simultaneously. |
10 | */ | 13 | */ |
11 | INC_BOMB { | 14 | INC_BOMB { |
12 | @Override | 15 | @Override |
13 | public Player applyTo(Player player) { | 16 | public Player applyTo(Player player) { |
14 | if (player.maxBombs() < BOMBS_LIMIT) { | 17 | if (player.maxBombs() < BOMBS_LIMIT) |
15 | return player.withMaxBombs(player.maxBombs() + 1); | 18 | return player.withMaxBombs(player.maxBombs() + 1); |
16 | } else { | 19 | else |
17 | return player.withMaxBombs(BOMBS_LIMIT); | 20 | return player.withMaxBombs(BOMBS_LIMIT); |
18 | } | ||
19 | } | 21 | } |
20 | }, | 22 | }, |
21 | 23 | ||
22 | /** | 24 | /** |
23 | * Increase the range of the bombs. | 25 | * Increases the range of the bombs. |
24 | */ | 26 | */ |
25 | INC_RANGE { | 27 | INC_RANGE { |
26 | @Override | 28 | @Override |
27 | public Player applyTo(Player player) { | 29 | public Player applyTo(Player player) { |
28 | if (player.bombRange() < RANGE_LIMIT) { | 30 | if (player.bombRange() < RANGE_LIMIT) |
29 | return player.withBombRange(player.bombRange() + 1); | 31 | return player.withBombRange(player.bombRange() + 1); |
30 | } else { | 32 | else |
31 | return player.withBombRange(RANGE_LIMIT); | 33 | return player.withBombRange(RANGE_LIMIT); |
32 | } | ||
33 | } | 34 | } |
34 | }; | 35 | }; |
35 | 36 | ||
@@ -50,4 +51,5 @@ public enum Bonus { | |||
50 | * @return a new player with the modified values | 51 | * @return a new player with the modified values |
51 | */ | 52 | */ |
52 | abstract public Player applyTo(Player player); | 53 | abstract public Player applyTo(Player player); |
54 | |||
53 | } | 55 | } |