ksys/act: Implement ActorLinkConstDataAccess

This commit is contained in:
Léo Lam
2020-08-20 01:26:10 +02:00
parent 6989d0f7f8
commit 0dc0752530
5 changed files with 55 additions and 5 deletions
@@ -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