diff options
Diffstat (limited to 'src/esieequest/controller/commands/ForwardCommand.java')
-rw-r--r-- | src/esieequest/controller/commands/ForwardCommand.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/esieequest/controller/commands/ForwardCommand.java b/src/esieequest/controller/commands/ForwardCommand.java new file mode 100644 index 0000000..f15a4e2 --- /dev/null +++ b/src/esieequest/controller/commands/ForwardCommand.java | |||
@@ -0,0 +1,24 @@ | |||
1 | package esieequest.controller.commands; | ||
2 | |||
3 | import esieequest.model.Game; | ||
4 | import esieequest.model.map.Direction; | ||
5 | import esieequest.view.View; | ||
6 | |||
7 | /** | ||
8 | * Allows the user to move forward in the Map (in the Room at the Direction he | ||
9 | * is facing). | ||
10 | * | ||
11 | * @author Pacien TRAN-GIRARD | ||
12 | */ | ||
13 | public class ForwardCommand implements CommandInterface { | ||
14 | |||
15 | @Override | ||
16 | public void execute(final String argument, final Game game, final View view) { | ||
17 | |||
18 | final Direction direction = game.getPlayer().getCurrentDirection(); | ||
19 | |||
20 | Command.GO.execute(direction.name(), game, view); | ||
21 | |||
22 | } | ||
23 | |||
24 | } | ||