aboutsummaryrefslogtreecommitdiff
path: root/frontend/cmd/query.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/cmd/query.cpp')
-rw-r--r--frontend/cmd/query.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/frontend/cmd/query.cpp b/frontend/cmd/query.cpp
index 48cbb55..367d6cd 100644
--- a/frontend/cmd/query.cpp
+++ b/frontend/cmd/query.cpp
@@ -1,6 +1,35 @@
+#include "backend/Location.h"
+
#include "../Player.h"
+#include "../print.h"
+
+using namespace std;
+
+static const unordered_map<Direction, string> direction_map = {
+ { Direction::NORTH, "Noord" },
+ { Direction::EAST, "Oost" },
+ { Direction::SOUTH, "Zuid" },
+ { Direction::WEST, "West" },
+};
FollowupAction Player::cmd_query(Argv argv) {
+ lprtf("Je staat bij de locatie %s.\n", this->location.get_name());
+ lprtf("%s\n", this->location.get_description());
+
+ // TODO: visible objects
+
+ lprtf("Uitgangen: ");
+ bool first = true;
+ for (Direction direction : DIRECTIONS) {
+ if (this->location.get_exit(direction) == nullptr) continue;
+ if (!first) lprtf(", ");
+ lprtf("%s", direction_map.at(direction).c_str());
+ first = false;
+ }
+ lprtf("\n");
+
+ // TODO: enemies
+
return FollowupAction::NONE;
}