aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/com/wordpress/tipsforjava/swing/StretchIcon.java5
-rw-r--r--src/esieequest/controller/Input.java17
-rw-r--r--src/esieequest/controller/commands/Executable.java2
-rw-r--r--src/esieequest/controller/utils/SerialisableObject.java5
-rw-r--r--src/esieequest/controller/utils/package-info.java1
-rw-r--r--src/esieequest/model/Game.java21
-rw-r--r--src/esieequest/model/Player.java73
-rw-r--r--src/esieequest/model/characters/MovingCharacter.java47
-rw-r--r--src/esieequest/model/characters/SimpleCharacter.java9
-rw-r--r--src/esieequest/model/doors/Door.java23
-rw-r--r--src/esieequest/model/doors/LockedDoor.java21
-rw-r--r--src/esieequest/model/items/SimpleItem.java31
-rw-r--r--src/esieequest/model/map/Side.java61
-rw-r--r--src/esieequest/view/Viewable.java10
-rw-r--r--src/esieequest/view/web/WebInterface.java2
-rw-r--r--src/org/json/simple/JSONStreamAware.java2
-rw-r--r--src/org/json/simple/parser/ContentHandler.java4
-rw-r--r--src/org/json/simple/parser/Yylex.java4
-rw-r--r--src/rejava/io/Writer.java4
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;
31public class StretchIcon extends ImageIcon { 31public 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 @@
1package esieequest.controller; 1package esieequest.controller;
2 2
3import lombok.Getter;
3import esieequest.controller.commands.Command; 4import esieequest.controller.commands.Command;
4 5
5/** 6/**
@@ -9,7 +10,9 @@ import esieequest.controller.commands.Command;
9 */ 10 */
10public class Input { 11public 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 */
4package esieequest.controller.utils; 4package 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 @@
1package esieequest.model; 1package esieequest.model;
2 2
3import lombok.Getter;
4import lombok.Setter;
3import net.pacien.util.CleanJSONObject; 5import net.pacien.util.CleanJSONObject;
4 6
5import org.json.simple.JSONArray; 7import 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;
3import java.util.ArrayList; 3import java.util.ArrayList;
4import java.util.Stack; 4import java.util.Stack;
5 5
6import lombok.Getter;
7import lombok.Setter;
6import net.pacien.util.CleanJSONObject; 8import net.pacien.util.CleanJSONObject;
7import net.pacien.util.IntrinsicMap; 9import net.pacien.util.IntrinsicMap;
8 10
@@ -26,18 +28,23 @@ import esieequest.model.map.Side;
26public class Player implements SerialisableObject { 28public 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 return this.currentRoom;
77 }
78
79 /**
80 * @param currentRoom
81 * the current Room to set