summaryrefslogtreecommitdiff
path: root/src/Game/Actor/Query/queryHasEnoughPayment.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Game/Actor/Query/queryHasEnoughPayment.cpp')
-rw-r--r--src/Game/Actor/Query/queryHasEnoughPayment.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/Game/Actor/Query/queryHasEnoughPayment.cpp b/src/Game/Actor/Query/queryHasEnoughPayment.cpp
new file mode 100644
index 00000000..64a5f148
--- /dev/null
+++ b/src/Game/Actor/Query/queryHasEnoughPayment.cpp
@@ -0,0 +1,27 @@
+#include "Game/Actor/Query/queryHasEnoughPayment.h"
+#include <evfl/Query.h>
+#include "KingSystem/GameData/gdtManager.h"
+
+namespace uking::query {
+
+HasEnoughPayment::HasEnoughPayment(const InitArg& arg) : ksys::act::ai::Query(arg) {}
+
+HasEnoughPayment::~HasEnoughPayment() = default;
+
+int HasEnoughPayment::doQuery() {
+ auto* gdm = ksys::gdt::Manager::instance();
+ if (gdm != nullptr) {
+ s32 state = -1;
+ if (!gdm->getParam().get().getS32(&state, "Shop_CurrentItemState"))
+ return 1;
+ if (state == 2 || state == 3)
+ return 0;
+ }
+ return 1;
+}
+
+void HasEnoughPayment::loadParams(const evfl::QueryArg& arg) {}
+
+void HasEnoughPayment::loadParams() {}
+
+} // namespace uking::query