diff --git a/src/KingSystem/ActorSystem/actAiAction.cpp b/src/KingSystem/ActorSystem/actAiAction.cpp index 742605ad..9c705302 100644 --- a/src/KingSystem/ActorSystem/actAiAction.cpp +++ b/src/KingSystem/ActorSystem/actAiAction.cpp @@ -9,6 +9,4 @@ void Action::calc() { calc_(); } -template class ClassContainer; - } // namespace ksys::act::ai diff --git a/src/KingSystem/ActorSystem/actAiAction.h b/src/KingSystem/ActorSystem/actAiAction.h index cef4e366..bc5e2f8f 100644 --- a/src/KingSystem/ActorSystem/actAiAction.h +++ b/src/KingSystem/ActorSystem/actAiAction.h @@ -1,5 +1,6 @@ #pragma once +#include #include "KingSystem/ActorSystem/actAiActionBase.h" #include "KingSystem/Utils/Types.h" @@ -18,4 +19,18 @@ protected: }; KSYS_CHECK_SIZE_NX150(Action, 0x20); +class Actions { +public: + Actions(); + ~Actions(); + + void finalize(); + + sead::Buffer classes; + // TODO: rename + sead::Buffer x; + // TODO: rename + sead::Buffer y; +}; + } // namespace ksys::act::ai diff --git a/src/KingSystem/ActorSystem/actAiAi.cpp b/src/KingSystem/ActorSystem/actAiAi.cpp index 9533981e..8fb4ab97 100644 --- a/src/KingSystem/ActorSystem/actAiAi.cpp +++ b/src/KingSystem/ActorSystem/actAiAi.cpp @@ -105,6 +105,4 @@ void Ai::updateChildIdx(u16 new_idx) { mPendingChildIdx = InvalidIdx; } -template class ClassContainer; - } // namespace ksys::act::ai diff --git a/src/KingSystem/ActorSystem/actAiAi.h b/src/KingSystem/ActorSystem/actAiAi.h index acb8c56b..8729b7d6 100644 --- a/src/KingSystem/ActorSystem/actAiAi.h +++ b/src/KingSystem/ActorSystem/actAiAi.h @@ -46,4 +46,18 @@ private: }; KSYS_CHECK_SIZE_NX150(Ai, 0x38); +class Ais { +public: + Ais(); + ~Ais(); + + void finalize(); + + sead::Buffer classes; + // TODO: rename + sead::Buffer x; + // TODO: rename + sead::Buffer y; +}; + } // namespace ksys::act::ai diff --git a/src/KingSystem/ActorSystem/actAiBehavior.cpp b/src/KingSystem/ActorSystem/actAiBehavior.cpp index c6e5b327..e60780fe 100644 --- a/src/KingSystem/ActorSystem/actAiBehavior.cpp +++ b/src/KingSystem/ActorSystem/actAiBehavior.cpp @@ -6,6 +6,4 @@ namespace ksys::act::ai { Behavior::Behavior(const InitArg& arg) : mActor(arg.actor), mDefIdx(static_cast(arg.def_idx)) {} -template class ClassContainer; - } // namespace ksys::act::ai diff --git a/src/KingSystem/ActorSystem/actAiBehavior.h b/src/KingSystem/ActorSystem/actAiBehavior.h index e65e6db9..993556ca 100644 --- a/src/KingSystem/ActorSystem/actAiBehavior.h +++ b/src/KingSystem/ActorSystem/actAiBehavior.h @@ -1,6 +1,7 @@ #pragma once #include +#include #include #include "KingSystem/Utils/Types.h" @@ -45,4 +46,18 @@ protected: }; KSYS_CHECK_SIZE_NX150(Behavior, 0x28); +class Behaviors { +public: + Behaviors(); + ~Behaviors(); + + void finalize(); + + sead::Buffer classes; + // TODO: rename + sead::Buffer x; + // TODO: rename + sead::Buffer y; +}; + } // namespace ksys::act::ai diff --git a/src/KingSystem/ActorSystem/actAiQuery.cpp b/src/KingSystem/ActorSystem/actAiQuery.cpp index 8cd16602..234866ca 100644 --- a/src/KingSystem/ActorSystem/actAiQuery.cpp +++ b/src/KingSystem/ActorSystem/actAiQuery.cpp @@ -77,6 +77,4 @@ bool Query::getAITreeVariable(void** value, const sead::SafeString& param) const return mActor->getRootAi()->getAITreeVariable(value, param); } -template class ClassContainer; - } // namespace ksys::act::ai diff --git a/src/KingSystem/ActorSystem/actAiQuery.h b/src/KingSystem/ActorSystem/actAiQuery.h index 99ed7977..3b094943 100644 --- a/src/KingSystem/ActorSystem/actAiQuery.h +++ b/src/KingSystem/ActorSystem/actAiQuery.h @@ -1,6 +1,7 @@ #pragma once #include +#include #include #include "KingSystem/ActorSystem/actAiParam.h" #include "KingSystem/Utils/Types.h" @@ -79,4 +80,18 @@ protected: }; KSYS_CHECK_SIZE_NX150(Query, 0x20); +class Queries { +public: + Queries(); + ~Queries(); + + void finalize(); + + sead::Buffer classes; + // TODO: rename + sead::Buffer x; + // TODO: rename + sead::Buffer y; +}; + } // namespace ksys::act::ai diff --git a/src/KingSystem/ActorSystem/actAiRoot.h b/src/KingSystem/ActorSystem/actAiRoot.h index 160dbfca..8f8cb4b5 100644 --- a/src/KingSystem/ActorSystem/actAiRoot.h +++ b/src/KingSystem/ActorSystem/actAiRoot.h @@ -1,37 +1,20 @@ #pragma once #include +#include "KingSystem/ActorSystem/actAiAction.h" #include "KingSystem/ActorSystem/actAiAi.h" +#include "KingSystem/ActorSystem/actAiBehavior.h" #include "KingSystem/ActorSystem/actAiParam.h" +#include "KingSystem/ActorSystem/actAiQuery.h" #include "KingSystem/Utils/Types.h" namespace ksys::act::ai { -class Action; -class Ai; -class Behavior; -class Query; - class IRootAi { public: virtual ~IRootAi() = default; }; -template -class ClassContainer { -public: - ClassContainer(); - ~ClassContainer(); - - void finalize(); - - sead::Buffer classes; - // TODO: rename - sead::Buffer x; - // TODO: rename - sead::Buffer y; -}; - enum class RootAiFlag : u16 { _100 = 0x100, // 8 }; @@ -57,10 +40,10 @@ public: u32 getI() const { return mI; } bool isActorDeletedOrDeleting() const; - const ClassContainer& getActions() const { return mActions; } - const ClassContainer& getAis() const { return mAis; } - const ClassContainer& getBehaviors() const { return mBehaviors; } - const ClassContainer& getQueries() const { return mQueries; } + const Actions& getActions() const { return mActions; } + const Ais& getAis() const { return mAis; } + const Behaviors& getBehaviors() const { return mBehaviors; } + const Queries& getQueries() const { return mQueries; } bool loadMapUnitParams(const AIDef& def, sead::Heap* heap); bool loadAITreeParams(const AIDef& def, sead::Heap* heap); @@ -102,10 +85,10 @@ private: f32 _40 = 1.0; u32 _44{}; - ClassContainer mActions; - ClassContainer mAis; - ClassContainer mBehaviors; - ClassContainer mQueries; + Actions mActions; + Ais mAis; + Behaviors mBehaviors; + Queries mQueries; sead::SafeArray mBehaviorsByStopAndCalcTiming[2]{}; void* _138{}; SomeStruct* _140{};