From 4f2f4ede4fa051bb2456d5ea245d8176b4f90d65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Mon, 21 Jun 2021 14:53:52 +0200 Subject: ksys/act: Finish Query --- src/KingSystem/ActorSystem/actAiQuery.cpp | 33 +++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'src/KingSystem/ActorSystem/actAiQuery.cpp') diff --git a/src/KingSystem/ActorSystem/actAiQuery.cpp b/src/KingSystem/ActorSystem/actAiQuery.cpp index b5467bb2..87b7af6b 100644 --- a/src/KingSystem/ActorSystem/actAiQuery.cpp +++ b/src/KingSystem/ActorSystem/actAiQuery.cpp @@ -1,4 +1,5 @@ #include "KingSystem/ActorSystem/actAiQuery.h" +#include #include "KingSystem/ActorSystem/actActor.h" #include "KingSystem/ActorSystem/actActorParam.h" #include "KingSystem/ActorSystem/actAiClassDef.h" @@ -70,6 +71,38 @@ bool Query::getDynamicParam(bool** value, const sead::SafeString& param) const { return ret != nullptr; } +bool Query::loadString(const evfl::ParamAccessor& accessor, const sead::SafeString& param) { + ore::StringView value; + if (!accessor.FindString(&value, param.cstr())) + return false; + + return mParamPack.setString(value.data(), param); +} + +bool Query::loadInt(const evfl::ParamAccessor& accessor, const sead::SafeString& param) { + int value; + if (!accessor.FindInt(&value, param.cstr())) + return false; + + return mParamPack.setVariable(param, AIDefParamType::Int, value); +} + +bool Query::loadFloat(const evfl::ParamAccessor& accessor, const sead::SafeString& param) { + float value; + if (!accessor.FindFloat(&value, param.cstr())) + return false; + + return mParamPack.setVariable(param, AIDefParamType::Float, value); +} + +bool Query::loadBool(const evfl::ParamAccessor& accessor, const sead::SafeString& param) { + bool value; + if (!accessor.FindBool(&value, param.cstr())) + return false; + + return mParamPack.setVariable(param, AIDefParamType::Bool, value); +} + bool Query::getAITreeVariable(sead::SafeString** value, const sead::SafeString& param) const { return mActor->getRootAi()->getAITreeVariable(value, param); } -- cgit v1.2.3