diff options
author | Pacien TRAN-GIRARD | 2016-03-15 14:51:34 +0100 |
---|---|---|
committer | Pacien TRAN-GIRARD | 2016-03-15 14:51:34 +0100 |
commit | 9ab2568b7519615165fa869c1852b0afbb4950e7 (patch) | |
tree | b099dbb7ab11c2c18070b2c7a41872a60c678c14 /src/ch/epfl | |
parent | bc0c2723e96b6b0769520eb33bc932fce688d62d (diff) | |
download | xblast-9ab2568b7519615165fa869c1852b0afbb4950e7.tar.gz |
Restore doc fixes and reformatting
Diffstat (limited to 'src/ch/epfl')
-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 | } |