diff options
21 files changed, 63 insertions, 280 deletions
@@ -6,5 +6,6 @@ | |||
6 | <classpathentry kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER"/> | 6 | <classpathentry kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER"/> |
7 | <classpathentry kind="lib" path="lib/guava-16.0.1.jar"/> | 7 | <classpathentry kind="lib" path="lib/guava-16.0.1.jar"/> |
8 | <classpathentry kind="lib" path="lib/guava-gwt-16.0.1.jar"/> | 8 | <classpathentry kind="lib" path="lib/guava-gwt-16.0.1.jar"/> |
9 | <classpathentry kind="lib" path="lib/lombok.jar"/> | ||
9 | <classpathentry kind="output" path="war/WEB-INF/classes"/> | 10 | <classpathentry kind="output" path="war/WEB-INF/classes"/> |
10 | </classpath> | 11 | </classpath> |
diff --git a/lib/lombok.jar b/lib/lombok.jar new file mode 100755 index 0000000..4141433 --- /dev/null +++ b/lib/lombok.jar | |||
Binary files differ | |||
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"; |