diff options
65 files changed, 2128 insertions, 1345 deletions
@@ -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 | ||
385 | 86d6f56dd - A code refactoring was done. | ||
386 | |||
385 | \subsection{Inheritance} | 387 | \subsection{Inheritance} |
386 | 388 | ||
389 | Inheritance (and interfaces) was already used for Character-s, Door-s, Item-s, | ||
390 | and View-s since the beginning. | ||
391 | |||
387 | \subsection{Abstract Command} | 392 | \subsection{Abstract Command} |
388 | 393 | ||
394 | The Performer class was replaced by multiple Command sub-types. | ||
395 | |||
389 | \subsection{Packages} | 396 | \subsection{Packages} |
390 | 397 | ||
398 | The 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 @@ | |||
1 | package esieequest.controller; | 1 | package esieequest.controller; |
2 | 2 | ||
3 | import esieequest.controller.commands.Command; | ||
3 | import esieequest.model.Game; | 4 | import esieequest.model.Game; |
5 | import esieequest.model.Text; | ||
6 | import esieequest.model.characters.MovingCharacter; | ||
4 | import esieequest.view.View; | 7 | import 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 |