diff options
| author | Léo Lam <leo@leolam.fr> | 2021-08-05 00:44:30 +0200 |
|---|---|---|
| committer | Léo Lam <leo@leolam.fr> | 2021-08-05 00:44:41 +0200 |
| commit | af2207632e4a07cc2c16615807521a69d2dad3c4 (patch) | |
| tree | ddc5e3b5ff8245f95dc1f013272d48c42c27f717 /src/KingSystem/ActorSystem | |
| parent | 6f7547e0db82695167f928d8b767900f0a2b7383 (diff) | |
ksys/act: Implement BaseProcJobHandlerT
Diffstat (limited to 'src/KingSystem/ActorSystem')
| -rw-r--r-- | src/KingSystem/ActorSystem/actBaseProcJobHandler.h | 14 |
1 files changed, 14 insertions, 0 deletions
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 <prim/seadDelegate.h> #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 <typename T> +class BaseProcJobHandlerT : public BaseProcJobHandler { +public: + BaseProcJobHandlerT(BaseProc* proc, void (T::*fn)()) + : BaseProcJobHandler(proc), mDelegate(proc, fn) {} + + void invoke() override { mDelegate.invoke(); } + +private: + sead::Delegate<T> mDelegate; +}; + } // namespace ksys::act |
