summaryrefslogtreecommitdiff
path: root/src/Game/Actor/Query/queryHasPorchItem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Game/Actor/Query/queryHasPorchItem.cpp')
-rw-r--r--src/Game/Actor/Query/queryHasPorchItem.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/Game/Actor/Query/queryHasPorchItem.cpp b/src/Game/Actor/Query/queryHasPorchItem.cpp
new file mode 100644
index 00000000..f8ac4e74
--- /dev/null
+++ b/src/Game/Actor/Query/queryHasPorchItem.cpp
@@ -0,0 +1,25 @@
+#include "Game/Actor/Query/queryHasPorchItem.h"
+#include <evfl/Query.h>
+#include "Game/UI/uiUtils.h"
+
+namespace uking::query {
+
+HasPorchItem::HasPorchItem(const InitArg& arg) : ksys::act::ai::Query(arg) {}
+
+HasPorchItem::~HasPorchItem() = default;
+
+int HasPorchItem::doQuery() {
+ return ui::getItemValue(mPorchItemName) >= *mCount;
+}
+
+void HasPorchItem::loadParams(const evfl::QueryArg& arg) {
+ loadInt(arg.param_accessor, "Count");
+ loadString(arg.param_accessor, "PorchItemName");
+}
+
+void HasPorchItem::loadParams() {
+ getDynamicParam(&mCount, "Count");
+ getDynamicParam(&mPorchItemName, "PorchItemName");
+}
+
+} // namespace uking::query