From 5422416c98bbeacb13bcb1ebacc2d9760e3d362d Mon Sep 17 00:00:00 2001 From: Pacien TRAN-GIRARD Date: Wed, 12 Mar 2014 10:57:49 +0100 Subject: Clean up. --- src/esieequest/controller/GameEngine.java | 2 +- src/esieequest/model/Game.java | 8 +++++--- src/esieequest/view/app/UserInterface.java | 2 +- src/esieequest/view/app/Window.java | 2 -- src/esieequest/view/console/Console.java | 4 +--- 5 files changed, 8 insertions(+), 10 deletions(-) (limited to 'src') 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 { this.view.setController(this); this.interpreter = new Interpreter(this.game, this.view); - + this.view.show(); } 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 { private final HashMap rooms; private Room currentRoom; - private Stack previousRooms; + private final Stack previousRooms; /** * The default constructor. @@ -51,7 +51,8 @@ public class Game { * @param exitRoomName * the name of the exit room */ - private void setRoomExit(final String roomName, final String direction, final String exitRoomName) { + private void setRoomExit(final String roomName, final String direction, + final String exitRoomName) { this.rooms.get(roomName).addExit(direction, this.rooms.get(exitRoomName)); } @@ -100,7 +101,8 @@ public class Game { this.createRoom("OffscriptLock", "somewhere implementing a doorlock"); this.createRoom("OffscriptLockLockedroom", "in a locked room that is not anymore"); this.createRoom("OffscriptAlea", "somewhere implementing alea"); - this.createRoom("OffscriptAleaRoomrandomizer", "in a weird room that will transport you somewhere else"); + this.createRoom("OffscriptAleaRoomrandomizer", + "in a weird room that will transport you somewhere else"); this.createRoom("OffscriptMovingcharacter", "somewhere implementing a moving character"); this.createRoom("OffscriptMovingcharacterMo", "in M-O's room"); 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 { this.infoTextPane.setText(message); this.clearInputField(); } - + @Override public void enable() { } 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; import javax.swing.JFrame; -import com.google.gwt.user.client.ui.RootLayoutPanel; - /** * The window view. * 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; import java.util.Scanner; -import com.google.gwt.user.client.ui.RootLayoutPanel; - import esieequest.controller.GameEngine; import esieequest.model.Game; import esieequest.view.View; @@ -31,7 +29,7 @@ public class Console implements View { * Runs the input scanner. */ private void run() { - Scanner scanner = new Scanner(System.in); + final Scanner scanner = new Scanner(System.in); while (this.running) { System.out.print("> "); this.gameEngine.interpret(scanner.nextLine()); -- cgit v1.2.3