22 void SetName(std::string name);
24 void SetAbsoluteID(std::string
id);
26 std::string GetName()
const {
30 std::string GetAbsoluteID()
const {
37 SetResource(asset,
false);
40 void LinkResource(std::string name) {
41 SetResource(std::move(name),
false);
45 static T* Create(
const std::string& name) {
48 if (res !=
nullptr)
return static_cast<T*
>(res);
53 res->SetResource(name);
59 if (asset ==
nullptr)
return nullptr;
61 SResource* res = GetResource(asset->name);
62 if (res !=
nullptr)
return static_cast<T*
>(res);
67 res->SetResource(asset);
72 static T* Get(std::string name) {
73 SResource* res = GetResource(std::move(name));
74 if (res !=
nullptr)
return static_cast<T*
>(res);
78 void SetHash(std::string& hash)
override;
84 void SetResource(std::string name,
bool isInit =
true);
88 static SResource* GetResource(std::string name);
92 std::string m_absoluteId;
93 bool m_isInited =
false;