2#include "Manager/MemoryMgr.h"
3#include "Manager/EngineCore.h"
4#include "Util/MoreString.h"
15 memoryMgr->Register(
this);
18SObject::SObject(
bool isRegister) {
20 if(isRegister) memoryMgr->Register(
this);
23SObject::~SObject() =
default;
26void SObject::SetUndestroyable(
bool enable) {
27 isUndestroyable = enable;
30void SObject::Destroy() {
31 memoryMgr->ReleaseObject(
this);
35void SObject::__FORCE_DESTROY__() {
36 memoryMgr->ReleaseObject(
this,
true);
39std::string SObject::GenerateMeta() {
43void SObject::GenerateHashString() {
44 std::random_device rd;
45 std::mt19937 gen(rd());
46 std::uniform_int_distribution<> dis(0, 61);
52 m_hash = GetRandomHash(16);
53 }
while (memoryMgr->HasHash(m_hash));
56void SObject::SetHash(std::string& hash) {
57 const std::string prevHash = std::string(m_hash);
60 memoryMgr->ChangeHash(prevHash, m_hash);
64 memoryMgr->ChangeHash(prevHash, hash);