aboutsummaryrefslogtreecommitdiff
path: root/frontend/cmd/search.cpp
blob: c11c9391e0a19ec6f135d3239784b49f5ed19495 (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
#include "../GameController.h"

#include "backend/print.h"
#include "backend/Location.h"
#include "backend/Dungeon.h"

using namespace std;

void GameController::cmd_search(string &) {
	Location & location = this->dungeon->get_player().get_location();

	bool found = false;
	for (Object * object : location.get_hidden_objects()) {
		if (!found) lprtf("Je vindt:\n");
		lprtf("- %s\n", object->get_displayname().c_str());
		location.unhide_object(object);
		found = true;
	}
	if (!found)
		lprtf("Je hebt niks gevonden.\n");

	this->dungeon->update();
}