summaryrefslogtreecommitdiff
path: root/src/Game/AI/Query/queryHasEnoughPayment.cpp
blob: 52b86453d8555770b070221e98cef2bb278b8121 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include "Game/AI/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