aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.classpath2
-rw-r--r--lib/guava-16.0.1.jarbin0 -> 2228009 bytes
-rw-r--r--lib/guava-gwt-16.0.1.jarbin0 -> 837282 bytes
-rw-r--r--report/progression.tex9
-rwxr-xr-xsrc/esieequest/Main.java6
-rw-r--r--src/esieequest/controller/GameEngine.java33
-rw-r--r--src/esieequest/controller/Input.java59
-rw-r--r--src/esieequest/controller/Interpreter.java110
-rw-r--r--src/esieequest/controller/Parser.java46
-rw-r--r--src/esieequest/controller/Performer.java320
-rw-r--r--src/esieequest/controller/Utils.java55
-rw-r--r--src/esieequest/controller/commands/AleaCommand.java39
-rw-r--r--src/esieequest/controller/commands/BackCommand.java21
-rw-r--r--src/esieequest/controller/commands/Command.java100
-rw-r--r--src/esieequest/controller/commands/CommandInterface.java25
-rw-r--r--src/esieequest/controller/commands/DoCommand.java35
-rw-r--r--src/esieequest/controller/commands/DropCommand.java41
-rw-r--r--src/esieequest/controller/commands/ForwardCommand.java24
-rw-r--r--src/esieequest/controller/commands/GoCommand.java52
-rw-r--r--src/esieequest/controller/commands/HelpCommand.java20
-rw-r--r--src/esieequest/controller/commands/InventoryCommand.java20
-rw-r--r--src/esieequest/controller/commands/LoadCommand.java19
-rw-r--r--src/esieequest/controller/commands/LookCommand.java29
-rw-r--r--src/esieequest/controller/commands/NewCommand.java28
-rw-r--r--src/esieequest/controller/commands/QuitCommand.java22
-rw-r--r--src/esieequest/controller/commands/SaveCommand.java19
-rw-r--r--src/esieequest/controller/commands/SoundCommand.java19
-rw-r--r--src/esieequest/controller/commands/TakeCommand.java52
-rw-r--r--src/esieequest/controller/commands/TalkCommand.java26
-rw-r--r--src/esieequest/controller/commands/TurnCommand.java37
-rw-r--r--src/esieequest/controller/commands/UseCommand.java35
-rw-r--r--src/esieequest/controller/commands/package-info.java4
-rw-r--r--src/esieequest/esieequest.gwt.xml7
-rw-r--r--src/esieequest/model/Game.java332
-rw-r--r--src/esieequest/model/Player.java298
-rw-r--r--src/esieequest/model/Text.java96
-rw-r--r--src/esieequest/model/characters/Character.java36
-rw-r--r--src/esieequest/model/characters/MovingCharacter.java133
-rw-r--r--src/esieequest/model/characters/Sumobot.java (renamed from src/esieequest/model/entities/Sumobot.java)22
-rw-r--r--src/esieequest/model/characters/package-info.java5
-rw-r--r--src/esieequest/model/commands/Command.java62
-rw-r--r--src/esieequest/model/commands/CommandWord.java12
-rw-r--r--src/esieequest/model/commands/package-info.java5
-rw-r--r--src/esieequest/model/doors/Door.java (renamed from src/esieequest/model/map/Door.java)21
-rw-r--r--src/esieequest/model/doors/HiddenDoor.java (renamed from src/esieequest/model/map/HiddenDoor.java)4
-rw-r--r--src/esieequest/model/doors/LockedDoor.java71
-rw-r--r--src/esieequest/model/doors/TransporterDoor.java54
-rw-r--r--src/esieequest/model/doors/TrapDoor.java (renamed from src/esieequest/model/map/TrapDoor.java)12
-rw-r--r--src/esieequest/model/doors/package-info.java4
-rw-r--r--src/esieequest/model/entities/Character.java25
-rw-r--r--src/esieequest/model/entities/MovingCharacter.java33
-rw-r--r--src/esieequest/model/entities/Player.java125
-rw-r--r--src/esieequest/model/entities/package-info.java5
-rw-r--r--src/esieequest/model/items/Beamer.java30
-rw-r--r--src/esieequest/model/items/Inventory.java125
-rw-r--r--src/esieequest/model/items/Item.java28
-rw-r--r--src/esieequest/model/map/Direction.java79
-rw-r--r--src/esieequest/model/map/LockedDoor.java55
-rw-r--r--src/esieequest/model/map/Orientation.java17
-rw-r--r--src/esieequest/model/map/Room.java279
-rw-r--r--src/esieequest/model/map/Side.java109
-rw-r--r--src/esieequest/model/map/TransporterDoor.java36
-rw-r--r--src/esieequest/view/app/UserInterface.java25
-rw-r--r--src/esieequest/view/text/TextInterface.java2
-rw-r--r--src/esieequest/view/web/WebInterface.java19
65 files changed, 2128 insertions, 1345 deletions
diff --git a/.classpath b/.classpath
index 8836eed..9697427 100644
--- a/.classpath
+++ b/.classpath
@@ -4,5 +4,7 @@
4 <classpathentry kind="src" path="res"/> 4 <classpathentry kind="src" path="res"/>
5 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> 5 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
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"/>
8 <classpathentry kind="lib" path="lib/guava-gwt-16.0.1.jar"/>
7 <classpathentry kind="output" path="war/WEB-INF/classes"/> 9 <classpathentry kind="output" path="war/WEB-INF/classes"/>
8</classpath> 10</classpath>
diff --git a/lib/guava-16.0.1.jar b/lib/guava-16.0.1.jar
new file mode 100644
index 0000000..2c8127d
--- /dev/null
+++ b/lib/guava-16.0.1.jar
Binary files differ
diff --git a/lib/guava-gwt-16.0.1.jar b/lib/guava-gwt-16.0.1.jar
new file mode 100644
index 0000000..d49ada7
--- /dev/null
+++ b/lib/guava-gwt-16.0.1.jar
Binary files differ
diff --git a/report/progression.tex b/report/progression.tex
index 1a74d8d..0108d2d 100644
--- a/report/progression.tex
+++ b/report/progression.tex
@@ -382,12 +382,21 @@ Moving characters that can move to adjacent rooms once permitted were added.
382 382
383\section{Zuul even better} 383\section{Zuul even better}
384 384
38586d6f56dd - A code refactoring was done.
386
385\subsection{Inheritance} 387\subsection{Inheritance}
386 388
389Inheritance (and interfaces) was already used for Character-s, Door-s, Item-s,
390and View-s since the beginning.
391
387\subsection{Abstract Command} 392\subsection{Abstract Command}
388 393
394The Performer class was replaced by multiple Command sub-types.
395
389\subsection{Packages} 396\subsection{Packages}
390 397
398The code was already organised in packages.
399
391 400
392\section{Zuul without BlueJ} 401\section{Zuul without BlueJ}
393 402
diff --git a/src/esieequest/Main.java b/src/esieequest/Main.java
index 362af9c..4759a6e 100755
--- a/src/esieequest/Main.java
+++ b/src/esieequest/Main.java
@@ -47,7 +47,7 @@ public class Main extends JApplet {
47 */ 47 */
48 public static void main(final String[] args) { 48 public static void main(final String[] args) {
49 final List<String> arguments = Arrays.asList(args); 49 final List<String> arguments = Arrays.asList(args);
50 final Game game = new Game(); 50 Game game;
51 View view; 51 View view;
52 52
53 if (arguments.contains("--file")) { 53 if (arguments.contains("--file")) {
@@ -63,7 +63,9 @@ public class Main extends JApplet {
63 } 63 }
64 64
65 if (arguments.contains("--challenge")) { 65 if (arguments.contains("--challenge")) {
66 game.getPlayer().setMaxNbSteps(50); 66 game = new Game(50);
67 } else {
68 game = new Game();
67 } 69 }
68 70
69 new GameEngine(game, view); 71 new GameEngine(game, view);
diff --git a/src/esieequest/controller/GameEngine.java b/src/esieequest/controller/GameEngine.java
index c09967b..df3d34a 100644
--- a/src/esieequest/controller/GameEngine.java
+++ b/src/esieequest/controller/GameEngine.java
@@ -1,6 +1,9 @@
1package esieequest.controller; 1package esieequest.controller;
2 2
3import esieequest.controller.commands.Command;
3import esieequest.model.Game; 4import esieequest.model.Game;
5import esieequest.model.Text;
6import esieequest.model.characters.MovingCharacter;
4import esieequest.view.View; 7import esieequest.view.View;
5 8
6/** 9/**
@@ -14,8 +17,6 @@ public class GameEngine {
14 private final Game game; 17 private final Game game;
15 private final View view; 18 private final View view;
16 19
17 private final Interpreter interpreter;
18
19 /** 20 /**
20 * Instantiates a game engine with the given model and view. 21 * Instantiates a game engine with the given model and view.
21 * 22 *
@@ -30,19 +31,35 @@ public class GameEngine {
30 31
31 this.view.setController(this); 32 this.view.setController(this);
32 33
33 this.interpreter = new Interpreter(this.game, this.view);
34
35 this.view.show(); 34 this.view.show();
36 } 35 }
37 36
38 /** 37 /**
39 * Interprets a command (forward it to the interpreter). 38 * Interprets a command.
40 * 39 *
41 * @param commandString 40 * @param commandString
42 * the command string 41