summaryrefslogtreecommitdiff
path: root/src/KingSystem/ActorSystem/actActorLinkConstDataAccess.cpp
diff options
context:
space:
mode:
authorLéo Lam <leo@leolam.fr>2020-08-20 01:26:10 +0200
committerLéo Lam <leo@leolam.fr>2020-08-20 01:26:10 +0200
commit0dc07525309ecc1d522fa4f18ecb09993b035f2b (patch)
tree46a42e8fd745dc443c979e99a14559eb70dae583 /src/KingSystem/ActorSystem/actActorLinkConstDataAccess.cpp
parent6989d0f7f833179130f43f5b7d6cf4c00cd52ece (diff)
ksys/act: Implement ActorLinkConstDataAccess
Diffstat (limited to 'src/KingSystem/ActorSystem/actActorLinkConstDataAccess.cpp')
-rw-r--r--src/KingSystem/ActorSystem/actActorLinkConstDataAccess.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/KingSystem/ActorSystem/actActorLinkConstDataAccess.cpp b/src/KingSystem/ActorSystem/actActorLinkConstDataAccess.cpp
index e69de29b..476482ce 100644
--- a/src/KingSystem/ActorSystem/actActorLinkConstDataAccess.cpp
+++ b/src/KingSystem/ActorSystem/actActorLinkConstDataAccess.cpp
@@ -0,0 +1,33 @@
+#include "KingSystem/ActorSystem/actActorLinkConstDataAccess.h"
+#include "KingSystem/ActorSystem/actBaseProc.h"
+
+namespace ksys::act {
+
+ActorLinkConstDataAccess::~ActorLinkConstDataAccess() {
+ if (mAcquired)
+ acquire(nullptr);
+}
+
+bool ActorLinkConstDataAccess::acquire(BaseProc* proc) {
+ if (mProc) {
+ if (mAcquired)
+ mProc->release();
+
+ mAcquired = false;
+ mProc = nullptr;
+ }
+
+ if (proc)
+ return proc->acquire(*this);
+ return false;
+}
+
+bool ActorLinkConstDataAccess::hasProc(BaseProc* proc) const {
+ return mProc == proc;
+}
+
+void ActorLinkConstDataAccess::debugLog(s32, const sead::SafeString&) {
+ // Intentionally left empty.
+}
+
+} // namespace ksys::act