diff --git a/src/KingSystem/ActorSystem/actBaseProcJobHandler.h b/src/KingSystem/ActorSystem/actBaseProcJobHandler.h index 29309498..002058a0 100644 --- a/src/KingSystem/ActorSystem/actBaseProcJobHandler.h +++ b/src/KingSystem/ActorSystem/actBaseProcJobHandler.h @@ -1,5 +1,6 @@ #pragma once +#include #include "KingSystem/ActorSystem/actBaseProcJob.h" #include "KingSystem/Utils/Types.h" @@ -20,4 +21,17 @@ protected: }; KSYS_CHECK_SIZE_NX150(BaseProcJobHandler, 0x30); +/// For binding actor member functions. +template +class BaseProcJobHandlerT : public BaseProcJobHandler { +public: + BaseProcJobHandlerT(BaseProc* proc, void (T::*fn)()) + : BaseProcJobHandler(proc), mDelegate(proc, fn) {} + + void invoke() override { mDelegate.invoke(); } + +private: + sead::Delegate mDelegate; +}; + } // namespace ksys::act