aboutsummaryrefslogtreecommitdiff
path: root/src/esieequest/controller/commands/LookCommand.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/esieequest/controller/commands/LookCommand.java')
-rw-r--r--src/esieequest/controller/commands/LookCommand.java29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/esieequest/controller/commands/LookCommand.java b/src/esieequest/controller/commands/LookCommand.java
new file mode 100644
index 0000000..d053b25
--- /dev/null
+++ b/src/esieequest/controller/commands/LookCommand.java
@@ -0,0 +1,29 @@
1package esieequest.controller.commands;
2
3import java.util.ArrayList;
4
5import com.google.common.base.Joiner;
6
7import esieequest.model.Game;
8import esieequest.model.Text;
9import esieequest.view.View;
10
11/**
12 * Prints informations about the current location.
13 *
14 * @author Pacien TRAN-GIRARD
15 */
16public class LookCommand implements CommandInterface {
17
18 @Override
19 public void execute(final String argument, final Game game, final View view) {
20
21 final ArrayList<String> informations = new ArrayList<String>();
22
23 informations.add(game.getPlayer().getCurrentRoom().getInformations());
24 informations.add(Text.DIRECTION_PREFIX + game.getPlayer().getCurrentDirection().name().toLowerCase() + Text.DIRECTION_SUFFIX);
25
26 view.echo(Joiner.on(Text.NEW_LINE.getText()).join(informations));
27
28 }
29}