aboutsummaryrefslogtreecommitdiff
path: root/frontend/cmd/query.cpp
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-10-30 15:27:59 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-10-30 15:27:59 +0100
commita3c1ba7b49e4c5901d7c9dd917049744ad20fc96 (patch)
tree66750c2c740aca751f47c2896985d2b79f6f7806 /frontend/cmd/query.cpp
parent6dfa3fb34fb0a2ea028fd46e77296e26b092fb99 (diff)
enemy loading kinda works
Diffstat (limited to 'frontend/cmd/query.cpp')
-rw-r--r--frontend/cmd/query.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/frontend/cmd/query.cpp b/frontend/cmd/query.cpp
index e1e45a1..23d2a42 100644
--- a/frontend/cmd/query.cpp
+++ b/frontend/cmd/query.cpp
@@ -1,5 +1,6 @@
#include "backend/Location.h"
#include "backend/Object.h"
+#include "backend/Enemy.h"
#include "../Player.h"
#include "../print.h"
@@ -43,7 +44,18 @@ FollowupAction Player::cmd_query(string &) {
lprtf("\n");
}
- // TODO: enemies
+ {
+ lprtf("Vijanden: ");
+ size_t enemies = 0;
+ for (Enemy * enemy : this->location.get_enemies()) {
+ if (enemies > 0) lprtf(", ");
+ lprtf("%s", enemy->get_name());
+ enemies++;
+ }
+ if (enemies == 0)
+ lprtf("(geen)");
+ lprtf("\n");
+ }
return FollowupAction::NONE;
}