diff options
author | Pacien TRAN-GIRARD | 2014-03-12 10:57:49 +0100 |
---|---|---|
committer | Pacien TRAN-GIRARD | 2014-03-12 10:57:49 +0100 |
commit | 5422416c98bbeacb13bcb1ebacc2d9760e3d362d (patch) | |
tree | 54da037c9cff2977ef2c12f1d21a32b3f25b0acb | |
parent | 2603c3643d180bf33748af87be668c5cb6e0b430 (diff) | |
download | esieequest-5422416c98bbeacb13bcb1ebacc2d9760e3d362d.tar.gz |
Clean up.
-rw-r--r-- | src/esieequest/controller/GameEngine.java | 2 | ||||
-rw-r--r-- | src/esieequest/model/Game.java | 8 | ||||
-rw-r--r-- | src/esieequest/view/app/UserInterface.java | 2 | ||||
-rw-r--r-- | src/esieequest/view/app/Window.java | 2 | ||||
-rw-r--r-- | src/esieequest/view/console/Console.java | 4 |
5 files changed, 8 insertions, 10 deletions
diff --git a/src/esieequest/controller/GameEngine.java b/src/esieequest/controller/GameEngine.java index 6c25fb3..01cf8c4 100644 --- a/src/esieequest/controller/GameEngine.java +++ b/src/esieequest/controller/GameEngine.java | |||
@@ -32,7 +32,7 @@ public class GameEngine { | |||
32 | this.view.setController(this); | 32 | this.view.setController(this); |
33 | 33 | ||
34 | this.interpreter = new Interpreter(this.game, this.view); | 34 | this.interpreter = new Interpreter(this.game, this.view); |
35 | 35 | ||
36 | this.view.show(); | 36 | this.view.show(); |
37 | } | 37 | } |
38 | 38 | ||
diff --git a/src/esieequest/model/Game.java b/src/esieequest/model/Game.java index 5f2049c..d5e7bfd 100644 --- a/src/esieequest/model/Game.java +++ b/src/esieequest/model/Game.java | |||
@@ -13,7 +13,7 @@ public class Game { | |||
13 | 13 | ||
14 | private final HashMap<String, Room> rooms; | 14 | private final HashMap<String, Room> rooms; |
15 | private Room currentRoom; | 15 | private Room currentRoom; |
16 | private Stack<Room> previousRooms; | 16 | private final Stack<Room> previousRooms; |
17 | 17 | ||
18 | /** | 18 | /** |
19 | * The default constructor. | 19 | * The default constructor. |
@@ -51,7 +51,8 @@ public class Game { | |||
51 | * @param exitRoomName | 51 | * @param exitRoomName |
52 | * the name of the exit room | 52 | * the name of the exit room |
53 | */ | 53 | */ |
54 | private void setRoomExit(final String roomName, final String direction, final String exitRoomName) { | 54 | private void setRoomExit(final String roomName, final String direction, |
55 | final String exitRoomName) { | ||
55 | this.rooms.get(roomName).addExit(direction, this.rooms.get(exitRoomName)); | 56 | this.rooms.get(roomName).addExit(direction, this.rooms.get(exitRoomName)); |
56 | } | 57 | } |
57 | 58 | ||
@@ -100,7 +101,8 @@ public class Game { | |||
100 | this.createRoom("OffscriptLock", "somewhere implementing a doorlock"); | 101 | this.createRoom("OffscriptLock", "somewhere implementing a doorlock"); |
101 | this.createRoom("OffscriptLockLockedroom", "in a locked room that is not anymore"); | 102 | this.createRoom("OffscriptLockLockedroom", "in a locked room that is not anymore"); |
102 | this.createRoom("OffscriptAlea", "somewhere implementing alea"); | 103 | this.createRoom("OffscriptAlea", "somewhere implementing alea"); |
103 | this.createRoom("OffscriptAleaRoomrandomizer", "in a weird room that will transport you somewhere else"); | 104 | this.createRoom("OffscriptAleaRoomrandomizer", |
105 | "in a weird room that will transport you somewhere else"); | ||
104 | this.createRoom("OffscriptMovingcharacter", "somewhere implementing a moving character"); | 106 | this.createRoom("OffscriptMovingcharacter", "somewhere implementing a moving character"); |
105 | this.createRoom("OffscriptMovingcharacterMo", "in M-O's room"); | 107 | this.createRoom("OffscriptMovingcharacterMo", "in M-O's room"); |
106 | 108 | ||
diff --git a/src/esieequest/view/app/UserInterface.java b/src/esieequest/view/app/UserInterface.java index 23384c7..1fc57bd 100644 --- a/src/esieequest/view/app/UserInterface.java +++ b/src/esieequest/view/app/UserInterface.java | |||
@@ -301,7 +301,7 @@ abstract class UserInterface implements View, ActionListener { | |||
301 | this.infoTextPane.setText(message); | 301 | this.infoTextPane.setText(message); |
302 | this.clearInputField(); | 302 | this.clearInputField(); |
303 | } | 303 | } |
304 | 304 | ||
305 | @Override | 305 | @Override |
306 | public void enable() { | 306 | public void enable() { |
307 | } | 307 | } |
diff --git a/src/esieequest/view/app/Window.java b/src/esieequest/view/app/Window.java index 82e3a2e..495986f 100644 --- a/src/esieequest/view/app/Window.java +++ b/src/esieequest/view/app/Window.java | |||
@@ -2,8 +2,6 @@ package esieequest.view.app; | |||
2 | 2 | ||
3 | import javax.swing.JFrame; | 3 | import javax.swing.JFrame; |
4 | 4 | ||
5 | import com.google.gwt.user.client.ui.RootLayoutPanel; | ||
6 | |||
7 | /** | 5 | /** |
8 | * The window view. | 6 | * The window view. |
9 | * | 7 | * |
diff --git a/src/esieequest/view/console/Console.java b/src/esieequest/view/console/Console.java index 0f3247a..6faaced 100644 --- a/src/esieequest/view/console/Console.java +++ b/src/esieequest/view/console/Console.java | |||
@@ -2,8 +2,6 @@ package esieequest.view.console; | |||
2 | 2 | ||
3 | import java.util.Scanner; | 3 | import java.util.Scanner; |
4 | 4 | ||
5 | import com.google.gwt.user.client.ui.RootLayoutPanel; | ||
6 | |||
7 | import esieequest.controller.GameEngine; | 5 | import esieequest.controller.GameEngine; |
8 | import esieequest.model.Game; | 6 | import esieequest.model.Game; |
9 | import esieequest.view.View; | 7 | import esieequest.view.View; |
@@ -31,7 +29,7 @@ public class Console implements View { | |||
31 | * Runs the input scanner. | 29 | * Runs the input scanner. |
32 | */ | 30 | */ |
33 | private void run() { | 31 | private void run() { |
34 | Scanner scanner = new Scanner(System.in); | 32 | final Scanner scanner = new Scanner(System.in); |
35 | while (this.running) { | 33 | while (this.running) { |
36 | System.out.print("> "); | 34 | System.out.print("> "); |
37 | this.gameEngine.interpret(scanner.nextLine()); | 35 | this.gameEngine.interpret(scanner.nextLine()); |