Definition at line 14 of file SResource.h.
◆ SResource() [1/3]
Definition at line 17 of file SResource.cpp.
17 {
18 auto resMgr = CORE->GetCore(
ResMgr);
19 resMgr->Register(this);
20 m_name = "Resource " + std::to_string(resMgr->GetSize());
21}
◆ SResource() [2/3]
SResource::SResource |
( |
bool |
isRegister | ) |
|
|
explicit |
Definition at line 23 of file SResource.cpp.
23 {
24 m_name = "Unregister Resource";
25}
◆ SResource() [3/3]
SResource::SResource |
( |
const SResource * |
resource, |
|
|
bool |
isRegister |
|
) |
| |
Definition at line 27 of file SResource.cpp.
28 if(isRegister) {
29 CORE->GetCore(
ResMgr)->Register(
this);
30 }
31 m_name = resource->m_name + " (instance)";
32}
◆ Create() [1/2]
Definition at line 58 of file SResource.h.
58 {
59 if (asset == nullptr) return nullptr;
60 {
61 SResource* res = GetResource(asset->name);
62 if (res != nullptr) return static_cast<T*>(res);
63 }
64 T* object = new T();
65 SResource* res = object;
66
67 res->SetResource(asset);
68 return object;
69 }
◆ Create() [2/2]
template<class T >
static T * CSE::SResource::Create |
( |
const std::string & |
name | ) |
|
|
inlinestatic |
Definition at line 45 of file SResource.h.
45 {
46 {
47 SResource* res = GetResource(name);
48 if (res != nullptr) return static_cast<T*>(res);
49 }
50 T* object = new T();
51 SResource* res = object;
52
53 res->SetResource(name);
54 return object;
55 }
◆ Get()
template<class T >
static T * CSE::SResource::Get |
( |
std::string |
name | ) |
|
|
inlinestatic |
Definition at line 72 of file SResource.h.
72 {
73 SResource* res = GetResource(std::move(name));
74 if (res != nullptr) return static_cast<T*>(res);
75 return nullptr;
76 }
◆ GetAbsoluteID()
std::string CSE::SResource::GetAbsoluteID |
( |
| ) |
const |
|
inline |
Definition at line 30 of file SResource.h.
30 {
31 return m_absoluteId;
32 }
◆ GetAssetReference()
Definition at line 85 of file SResource.cpp.
85 {
86 if(hash.empty()) hash = m_hash;
87 return CORE->GetCore(
ResMgr)->GetAssetReference(std::move(hash));
88}
◆ GetName()
std::string CSE::SResource::GetName |
( |
| ) |
const |
|
inline |
Definition at line 26 of file SResource.h.
26 {
27 return m_name;
28 }
◆ LinkResource() [1/2]
Definition at line 36 of file SResource.h.
36 {
37 SetResource(asset, false);
38 }
◆ LinkResource() [2/2]
void CSE::SResource::LinkResource |
( |
std::string |
name | ) |
|
|
inline |
Definition at line 40 of file SResource.h.
40 {
41 SetResource(std::move(name), false);
42 }
◆ SetAbsoluteID()
void SResource::SetAbsoluteID |
( |
std::string |
id | ) |
|
Definition at line 40 of file SResource.cpp.
40 {
41 m_absoluteId = std::move(id);
42}
◆ SetHash()
void SResource::SetHash |
( |
std::string & |
hash | ) |
|
|
overridevirtual |
Reimplemented from CSE::SObject.
Definition at line 79 of file SResource.cpp.
79 {
80 std::string srcHash = m_hash;
81 SObject::SetHash(hash);
82 CORE->GetCore(
ResMgr)->ChangeHash(srcHash, hash);
83}
◆ SetName()
void SResource::SetName |
( |
std::string |
name | ) |
|
Definition at line 36 of file SResource.cpp.
36 {
37 m_name = std::move(name);
38}
The documentation for this class was generated from the following files: