aboutsummaryrefslogtreecommitdiff
path: root/frontend/cmd/search.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/cmd/search.cpp')
-rw-r--r--frontend/cmd/search.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/frontend/cmd/search.cpp b/frontend/cmd/search.cpp
index 4646ddc..67b0bf1 100644
--- a/frontend/cmd/search.cpp
+++ b/frontend/cmd/search.cpp
@@ -1,9 +1,21 @@
#include "../Player.h"
+#include "../print.h"
+
+#include "backend/Location.h"
using namespace std;
-FollowupAction Player::cmd_search(string & argv) {
- // TODO
+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;
}