aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBenoît LUBRANO DI SBARAGLIONE2014-06-05 15:37:35 +0200
committerBenoît LUBRANO DI SBARAGLIONE2014-06-05 15:37:35 +0200
commit728e80ade4d37659fb09ab4ea7db826a58311398 (patch)
tree20c3699dd6b81b7d362d9e9a10c1fc1119ae8ab0 /src
parented17087e33c72794eb8590404c7f82e6bd2aa287 (diff)
downloadesieequest-728e80ade4d37659fb09ab4ea7db826a58311398.tar.gz
Add Kill Command !
Diffstat (limited to 'src')
-rw-r--r--src/esieequest/engine/GameEngine.java2
-rw-r--r--src/esieequest/engine/commands/Command.java1
-rw-r--r--src/esieequest/engine/commands/KillCommand.java23
-rw-r--r--src/esieequest/game/Text.java1
4 files changed, 26 insertions, 1 deletions
diff --git a/src/esieequest/engine/GameEngine.java b/src/esieequest/engine/GameEngine.java
index 9211eb0..ebd37b4 100644
--- a/src/esieequest/engine/GameEngine.java
+++ b/src/esieequest/engine/GameEngine.java
@@ -111,7 +111,7 @@ public class GameEngine {
111 return; 111 return;
112 } 112 }
113 }); 113 });
114 this.view.echo("You are trapped. You losed."); 114 this.view.echo("You are trapped. Game Over.");
115 } 115 }
116 116
117 } 117 }
diff --git a/src/esieequest/engine/commands/Command.java b/src/esieequest/engine/commands/Command.java
index 5c44e9b..e73856a 100644
--- a/src/esieequest/engine/commands/Command.java
+++ b/src/esieequest/engine/commands/Command.java
@@ -43,6 +43,7 @@ public enum Command {
43 43
44 // shortcuts 44 // shortcuts
45 DO(new DoCommand()), 45 DO(new DoCommand()),
46 KILL(new KillCommand()),
46 47
47 ; 48 ;
48 49
diff --git a/src/esieequest/engine/commands/KillCommand.java b/src/esieequest/engine/commands/KillCommand.java
new file mode 100644
index 0000000..bcc0021
--- /dev/null
+++ b/src/esieequest/engine/commands/KillCommand.java
@@ -0,0 +1,23 @@
1package esieequest.engine.commands;
2
3import esieequest.game.Game;
4import esieequest.game.Text;
5import esieequest.ui.View;
6
7public class KillCommand implements Executable {
8
9 @Override
10 public void execute(final String argument, final Game game, final View view) {
11
12 if (!argument.isEmpty()) {
13 view.echo(Text.TOO_MANY_ARGUMENTS.toString());
14 return;
15 }
16
17 view.echo(Text.KILL.toString());
18 view.disableInput();
19 view.stopMusic();
20
21 }
22
23}
diff --git a/src/esieequest/game/Text.java b/src/esieequest/game/Text.java
index 7f74e58..b4ad037 100644
--- a/src/esieequest/game/Text.java
+++ b/src/esieequest/game/Text.java
@@ -55,6 +55,7 @@ public enum Text {
55 WELCOME("Welcome to ESIEEquest! ESIEEquest is a new, amazingly boring adventure game."), 55 WELCOME("Welcome to ESIEEquest! ESIEEquest is a new, amazingly boring adventure game."),
56 CHALLENGE_FAILED("Challenge failed: you died from exhaustion..."), 56 CHALLENGE_FAILED("Challenge failed: you died from exhaustion..."),
57 QUIT("Thanks for wasting your time. Good bye."), 57 QUIT("Thanks for wasting your time. Good bye."),
58 KILL("You killed yourself ! Game Over."),
58 59
59 ALEA_OVERRIDE_ENABLED("Alea override enabled."), 60 ALEA_OVERRIDE_ENABLED("Alea override enabled."),
60 ALEA_OVERRIDE_DISABLED("Alea override disabled."), 61 ALEA_OVERRIDE_DISABLED("Alea override disabled."),