diff options
Diffstat (limited to 'src/esieequest/controller/commands/LookCommand.java')
-rw-r--r-- | src/esieequest/controller/commands/LookCommand.java | 29 |
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 @@ | |||
1 | package esieequest.controller.commands; | ||
2 | |||
3 | import java.util.ArrayList; | ||
4 | |||
5 | import com.google.common.base.Joiner; | ||
6 | |||
7 | import esieequest.model.Game; | ||
8 | import esieequest.model.Text; | ||
9 | import esieequest.view.View; | ||
10 | |||
11 | /** | ||
12 | * Prints informations about the current location. | ||
13 | * | ||
14 | * @author Pacien TRAN-GIRARD | ||
15 | */ | ||
16 | public 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 | } | ||