diff options
author | Pacien TRAN-GIRARD | 2014-06-01 19:27:12 +0200 |
---|---|---|
committer | Pacien TRAN-GIRARD | 2014-06-01 19:27:12 +0200 |
commit | 5b7c510ce0751a696a309a60c4fc281ff523da32 (patch) | |
tree | 3d8fb155436d6ca8e825e9c3d33ee9e84464dd1e | |
parent | 5fb9aef73b75cfc2c60c6566789f9cfe7c370059 (diff) | |
download | esieequest-5b7c510ce0751a696a309a60c4fc281ff523da32.tar.gz |
Refactor UI components
67 files changed, 1686 insertions, 1382 deletions
diff --git a/src/esieequest/Main.java b/src/esieequest/Main.java index c755741..dd548f1 100755 --- a/src/esieequest/Main.java +++ b/src/esieequest/Main.java | |||
@@ -6,9 +6,9 @@ import java.util.List; | |||
6 | import javax.swing.JApplet; | 6 | import javax.swing.JApplet; |
7 | 7 | ||
8 | import esieequest.engine.GameEngine; | 8 | import esieequest.engine.GameEngine; |
9 | import esieequest.ui.Viewable; | 9 | import esieequest.ui.View; |
10 | import esieequest.ui.rich.Applet; | 10 | import esieequest.ui.rich.app.Applet; |
11 | import esieequest.ui.rich.Window; | 11 | import esieequest.ui.rich.app.Window; |
12 | import esieequest.ui.text.Console; | 12 | import esieequest.ui.text.Console; |
13 | import esieequest.ui.text.FileReader; | 13 | import esieequest.ui.text.FileReader; |
14 | 14 | ||
@@ -45,7 +45,7 @@ public class Main extends JApplet { | |||
45 | */ | 45 | */ |
46 | public static void main(final String[] args) { | 46 | public static void main(final String[] args) { |
47 | final List<String> arguments = Arrays.asList(args); | 47 | final List<String> arguments = Arrays.asList(args); |
48 | Viewable view; | 48 | View view; |
49 | 49 | ||
50 | if (arguments.contains("--file")) { | 50 | if (arguments.contains("--file")) { |
51 | if (arguments.size() < 2) { | 51 | if (arguments.size() < 2) { |
diff --git a/src/esieequest/engine/GameEngine.java b/src/esieequest/engine/GameEngine.java index 573d3a8..9211eb0 100644 --- a/src/esieequest/engine/GameEngine.java +++ b/src/esieequest/engine/GameEngine.java | |||
@@ -1,15 +1,15 @@ | |||
1 | package esieequest.engine; | 1 | package esieequest.engine; |
2 | 2 | ||
3 | import esieequest.engine.commands.Command; | 3 | import esieequest.engine.commands.Command; |
4 | import esieequest.engine.scheduler.Callback; | ||
4 | import esieequest.game.Game; | 5 | import esieequest.game.Game; |
5 | import esieequest.game.Text; | 6 | import esieequest.game.Text; |
6 | import esieequest.game.characters.MovingCharacter; | 7 | import esieequest.game.characters.MovingCharacter; |
7 | import esieequest.game.items.Beamer; | 8 | import esieequest.game.items.Beamer; |
8 | import esieequest.game.items.Item; | 9 | import esieequest.game.items.Item; |
9 | import esieequest.game.map.Room; | 10 | import esieequest.game.map.Room; |
10 | import esieequest.game.states.Callback; | ||
11 | import esieequest.game.states.Scene; | 11 | import esieequest.game.states.Scene; |
12 | import esieequest.ui.Viewable; | 12 | import esieequest.ui.View; |
13 | 13 | ||
14 | /** | 14 | /** |
15 | * The game main controller class. | 15 | * The game main controller class. |
@@ -20,7 +20,7 @@ import esieequest.ui.Viewable; | |||
20 | public class GameEngine { | 20 | public class GameEngine { |
21 | 21 | ||
22 | private final Game game; | 22 | private final Game game; |
23 | private final Viewable view; | 23 | private final View view; |
24 | 24 | ||
25 | /** | 25 | /** |
26 | * Instantiates a game engine with the given model and view. | 26 | * Instantiates a game engine with the given model and view. |
@@ -30,11 +30,11 @@ public class GameEngine { | |||
30 | * @param view | 30 | * @param view |
31 | * the view | 31 | * the view |
32 | */ | 32 | */ |
33 | public GameEngine(final Viewable view, final Game game) { | 33 | public GameEngine(final View view, final Game game) { |
34 | this.game = game; | 34 | this.game = game; |
35 | this.view = view; | 35 | this.view = view; |
36 | 36 | ||
37 | this.view.setController(this); | 37 | this.view.setGameEngine(this); |
38 | 38 | ||
39 | this.view.show(); | 39 | this.view.show(); |
40 | } | 40 | } |
@@ -47,7 +47,7 @@ public class GameEngine { | |||
47 | * @param challengeMode | 47 | * @param challengeMode |
48 | * the mode | 48 | * the mode |
49 | */ | 49 | */ |
50 | public GameEngine(final Viewable view, final boolean challengeMode) { | 50 | public GameEngine(final View view, final boolean challengeMode) { |
51 | this(view, new Game(challengeMode)); | 51 | this(view, new Game(challengeMode)); |
52 | } | 52 | } |
53 | 53 | ||
@@ -57,7 +57,7 @@ public class GameEngine { | |||
57 | * @param view | 57 | * @param view |
58 | * the view | 58 | * the view |
59 | */ | 59 | */ |
60 | public GameEngine(final Viewable view) { | 60 | public GameEngine(final View view) { |
61 | this(view, false); | 61 | this(view, false); |
62 | } | 62 | } |
63 | 63 | ||
diff --git a/src/esieequest/engine/audioplayer/AudioPlayer.java b/src/esieequest/engine/audioplayer/AudioPlayer.java new file mode 100644 index 0000000..3b65ec5 --- /dev/null +++ b/src/esieequest/engine/audioplayer/AudioPlayer.java | |||
@@ -0,0 +1,31 @@ | |||
1 | package esieequest.engine.audioplayer; | ||
2 | |||
3 | /** | ||
4 | * The audio player adapter interface. | ||
5 | * | ||
6 | * @author Pacien TRAN-GIRARD | ||
7 | */ | ||
8 | public interface AudioPlayer { | ||
9 | |||
10 | public static final String SOUND_DIR = "resources/audio/"; | ||