aboutsummaryrefslogtreecommitdiff
path: root/frontend/cmd/query.cpp
blob: 367d6cd4a4179f7daba20044c1123d84a89b3664 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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;
}