aboutsummaryrefslogtreecommitdiff
path: root/frontend/cmd/search.cpp
blob: 67b0bf1cbbf4a1c732b9a4409eaf22281b43c089 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "../Player.h"
#include "../print.h"

#include "backend/Location.h"

using namespace std;

FollowupAction Player::cmd_search(string &) {
	bool found = false;
	for (Object * object : this->location.get_objects()) {
		if (object->get_hidden() == false) continue;
		if (!found) lprtf("Je vindt:\n");
		lprtf("- %s\n", object->get_displayname());
		object->set_hidden(false);
		found = true;
	}
	if (!found)
		lprtf("Je hebt niks gevonden.\n");
	return FollowupAction::UPDATE;
}