diff options
author | Pacien TRAN-GIRARD | 2014-05-04 18:10:35 +0200 |
---|---|---|
committer | Pacien TRAN-GIRARD | 2014-05-04 18:10:35 +0200 |
commit | b8cafdd1c70b3fbb455ee6821c3dd0e5dc587188 (patch) | |
tree | bf84b623ddec71edfbfc68f16d5530a3e11f7155 /src | |
parent | 688634ae5a5aaf663159032e67d2132ea61c5d5f (diff) | |
download | esieequest-b8cafdd1c70b3fbb455ee6821c3dd0e5dc587188.tar.gz |
Use lombok and clean up
Diffstat (limited to 'src')
19 files changed, 62 insertions, 280 deletions
diff --git a/src/com/wordpress/tipsforjava/swing/StretchIcon.java b/src/com/wordpress/tipsforjava/swing/StretchIcon.java index d41bbfe..7c7181f 100644 --- a/src/com/wordpress/tipsforjava/swing/StretchIcon.java +++ b/src/com/wordpress/tipsforjava/swing/StretchIcon.java | |||
@@ -31,6 +31,11 @@ import javax.swing.ImageIcon; | |||
31 | public class StretchIcon extends ImageIcon { | 31 | public class StretchIcon extends ImageIcon { |
32 | 32 | ||
33 | /** | 33 | /** |
34 | * | ||
35 | */ | ||
36 | private static final long serialVersionUID = 6948448082634127156L; | ||
37 | |||
38 | /** | ||
34 | * Determines whether the aspect ratio of the image is maintained. Set to | 39 | * Determines whether the aspect ratio of the image is maintained. Set to |
35 | * <code>false</code> to distort the image to fill the component. | 40 | * <code>false</code> to distort the image to fill the component. |
36 | */ | 41 | */ |
diff --git a/src/esieequest/controller/Input.java b/src/esieequest/controller/Input.java index 4b4ada5..784985e 100644 --- a/src/esieequest/controller/Input.java +++ b/src/esieequest/controller/Input.java | |||
@@ -1,5 +1,6 @@ | |||
1 | package esieequest.controller; | 1 | package esieequest.controller; |
2 | 2 | ||
3 | import lombok.Getter; | ||
3 | import esieequest.controller.commands.Command; | 4 | import esieequest.controller.commands.Command; |
4 | 5 | ||
5 | /** | 6 | /** |
@@ -9,7 +10,9 @@ import esieequest.controller.commands.Command; | |||
9 | */ | 10 | */ |
10 | public class Input { | 11 | public class Input { |
11 | 12 | ||
13 | @Getter | ||
12 | private Command command; | 14 | private Command command; |
15 | @Getter | ||
13 | private final String argument; | 16 | private final String argument; |
14 | 17 | ||
15 | /** | 18 | /** |
@@ -42,18 +45,4 @@ public class Input { | |||
42 | } | 45 | } |
43 | } | 46 | } |
44 | 47 | ||
45 | /** | ||
46 | * @return the command | ||
47 | */ | ||
48 | public Command getCommand() { | ||
49 | return this.command; | ||
50 | } | ||
51 | |||
52 | /** | ||
53 | * @return the argument | ||
54 | */ | ||
55 | public String getArgument() { | ||
56 | return this.argument; | ||
57 | } | ||
58 | |||
59 | } | 48 | } |
diff --git a/src/esieequest/controller/commands/Executable.java b/src/esieequest/controller/commands/Executable.java index 36ec6be..156fc1c 100644 --- a/src/esieequest/controller/commands/Executable.java +++ b/src/esieequest/controller/commands/Executable.java | |||
@@ -20,6 +20,6 @@ public interface Executable { | |||
20 | * @param view | 20 | * @param view |
21 | * the View | 21 | * the View |
22 | */ | 22 | */ |
23 | public void execute(String argument, Game game, Viewable view); | 23 | public void execute(final String argument, final Game game, final Viewable view); |
24 | 24 | ||
25 | } | 25 | } |
diff --git a/src/esieequest/controller/utils/SerialisableObject.java b/src/esieequest/controller/utils/SerialisableObject.java index 30b9c19..334f408 100644 --- a/src/esieequest/controller/utils/SerialisableObject.java +++ b/src/esieequest/controller/utils/SerialisableObject.java | |||
@@ -19,8 +19,9 @@ public interface SerialisableObject { | |||
19 | /** | 19 | /** |
20 | * Deserialises from a JSONObject. | 20 | * Deserialises from a JSONObject. |
21 | * | 21 | * |
22 | * @param o the JSONObject | 22 | * @param o |
23 | * the JSONObject | ||
23 | */ | 24 | */ |
24 | public void deserialise(JSONObject o); | 25 | public void deserialise(final JSONObject o); |
25 | 26 | ||
26 | } | 27 | } |
diff --git a/src/esieequest/controller/utils/package-info.java b/src/esieequest/controller/utils/package-info.java index 088a127..2e6d871 100644 --- a/src/esieequest/controller/utils/package-info.java +++ b/src/esieequest/controller/utils/package-info.java | |||
@@ -2,3 +2,4 @@ | |||
2 | * A general utility package. | 2 | * A general utility package. |
3 | */ | 3 | */ |
4 | package esieequest.controller.utils; | 4 | package esieequest.controller.utils; |
5 | |||
diff --git a/src/esieequest/model/Game.java b/src/esieequest/model/Game.java index 7f124e7..05fdcd2 100644 --- a/src/esieequest/model/Game.java +++ b/src/esieequest/model/Game.java | |||
@@ -1,5 +1,7 @@ | |||
1 | package esieequest.model; | 1 | package esieequest.model; |
2 | 2 | ||
3 | import lombok.Getter; | ||
4 | import lombok.Setter; | ||
3 | import net.pacien.util.CleanJSONObject; | 5 | import net.pacien.util.CleanJSONObject; |
4 | 6 | ||
5 | import org.json.simple.JSONArray; | 7 | import org.json.simple.JSONArray; |
@@ -33,6 +35,8 @@ public class Game implements SerialisableObject { | |||
33 | private final boolean challenge; | 35 | private final boolean challenge; |
34 | 36 | ||
35 | private static final String PLAYER_LABEL = "P"; | 37 | private static final String PLAYER_LABEL = "P"; |
38 | @Getter | ||
39 | @Setter | ||
36 | private Player player; | 40 | private Player player; |
37 | 41 | ||
38 | private static final String ROOMS_LABEL = "R"; | 42 | private static final String ROOMS_LABEL = "R"; |
@@ -72,23 +76,6 @@ public class Game implements SerialisableObject { | |||
72 | } | 76 | } |
73 | 77 | ||
74 | /** | 78 | /** |
75 | * @return the player | ||
76 | */ | ||
77 | public Player getPlayer() { | ||
78 | return this.player; | ||
79 | } | ||
80 | |||
81 | /** | ||
82 | * Sets the player | ||
83 | * | ||
84 | * @param player | ||
85 | * the Player to set | ||
86 | */ | ||
87 | public void setPlayer(final Player player) { | ||
88 | this.player = player; | ||
89 | } | ||
90 | |||
91 | /** | ||
92 | * Connects Room-s together using Door-s. | 79 | * Connects Room-s together using Door-s. |
93 | */ | 80 | */ |
94 | public void connectRooms() { | 81 | public void connectRooms() { |
diff --git a/src/esieequest/model/Player.java b/src/esieequest/model/Player.java index 371de84..68930e2 100644 --- a/src/esieequest/model/Player.java +++ b/src/esieequest/model/Player.java | |||
@@ -3,6 +3,8 @@ package esieequest.model; | |||
3 | import java.util.ArrayList; | 3 | import java.util.ArrayList; |
4 | import java.util.Stack; | 4 | import java.util.Stack; |
5 | 5 | ||
6 | import lombok.Getter; | ||
7 | import lombok.Setter; | ||
6 | import net.pacien.util.CleanJSONObject; | 8 | import net.pacien.util.CleanJSONObject; |
7 | import net.pacien.util.IntrinsicMap; | 9 | import net.pacien.util.IntrinsicMap; |
8 | 10 | ||
@@ -26,18 +28,23 @@ import esieequest.model.map.Side; | |||
26 | public class Player implements SerialisableObject { | 28 | public class Player implements SerialisableObject { |
27 | 29 | ||
28 | private static final String CURRENT_ROOM_LABEL = "R"; | 30 | private static final String CURRENT_ROOM_LABEL = "R"; |
31 | @Getter | ||
32 | @Setter | ||
29 | private Room currentRoom; | 33 | private Room currentRoom; |
30 | 34 | ||
31 | private static final String PREVIOUS_ROOMS_LABEL = "H"; | 35 | private static final String PREVIOUS_ROOMS_LABEL = "H"; |
32 | private final Stack<Room> previousRooms; | 36 | private final Stack<Room> previousRooms; |
33 | 37 | ||
34 | private static final String CURRENT_DIRECTION_LABEL = "D"; | 38 | private static final String CURRENT_DIRECTION_LABEL = "D"; |
39 | @Getter | ||
40 | @Setter | ||
35 | private Direction currentDirection; | 41 | private Direction currentDirection; |
36 | 42 | ||
37 | private static final String ITEMS_LABEL = "I"; | 43 | private static final String ITEMS_LABEL = "I"; |
38 | private final IntrinsicMap<String, Item> items; | 44 | private final IntrinsicMap<String, Item> items; |
39 | 45 | ||
40 | private static final String INVENTORY_WEIGHT_LIMIT_LABEL = "W"; | 46 | private static final String INVENTORY_WEIGHT_LIMIT_LABEL = "W"; |
47 | @Getter | ||
41 | private int inventoryWeightLimit; | 48 | private int inventoryWeightLimit; |
42 | 49 | ||
43 | private static final String NB_STEPS_LABEL = "S"; | 50 | private static final String NB_STEPS_LABEL = "S"; |
@@ -70,72 +77,6 @@ public class Player implements SerialisableObject { | |||
70 | } | 77 | } |
71 | 78 | ||
72 | /** | 79 | /** |
73 | * @return the current Room | ||
74 | */ | ||
75 | public Room getCurrentRoom() { | ||
76 | r |