mirror of https://github.com/PrimeDecomp/prime.git
36 lines
786 B
C++
36 lines
786 B
C++
#ifndef _CTOKEN
|
|
#define _CTOKEN
|
|
|
|
#include "types.h"
|
|
|
|
#include "Kyoto/CObjectReference.hpp"
|
|
#include "Kyoto/IObj.hpp"
|
|
|
|
class CObjectReference;
|
|
|
|
class CToken {
|
|
public:
|
|
CToken() {}
|
|
CToken(CObjectReference* ref);
|
|
CToken(IObj* obj); // : x0_objRef(new CObjectReference(obj)), x4_lockHeld(false) {}
|
|
CToken(const CToken& other);
|
|
~CToken();
|
|
|
|
CObjOwnerDerivedFromIObjUntyped* GetObj();
|
|
void Lock();
|
|
void Unlock();
|
|
bool IsLoaded() const { return x0_objRef->IsLoaded(); }
|
|
void RemoveRef();
|
|
CToken& operator=(const CToken&);
|
|
bool HasReference() const { return x0_objRef != nullptr; }
|
|
FourCC GetReferenceType() { return x0_objRef->GetTag().type; }
|
|
|
|
bool HasLock() { return x4_lockHeld; }
|
|
|
|
private:
|
|
CObjectReference* x0_objRef;
|
|
bool x4_lockHeld;
|
|
};
|
|
|
|
#endif // _CTOKEN
|