19 explicit SResource(std::string classType);
25 void SetName(std::string name);
27 void SetAbsoluteID(std::string
id);
29 std::string GetName()
const {
33 std::string GetAbsoluteID()
const {
40 SetResource(asset,
false);
43 void LinkResource(std::string name) {
44 SetResource(std::move(name),
false);
48 static T* Create(
const std::string& name) {
51 if (res !=
nullptr)
return static_cast<T*
>(res);
56 res->SetResource(name);
60 static SResource* Create(
const std::string& name,
const std::string& classType);
64 if (asset ==
nullptr)
return nullptr;
66 SResource* res = GetResource(asset->hash);
67 if (res !=
nullptr)
return static_cast<T*
>(res);
79 static T* Get(std::string name) {
80 SResource* res = GetResource(std::move(name));
81 if (res !=
nullptr)
return static_cast<T*
>(res);
87 void SetHash(std::string& hash)
override;
93 void SetResource(std::string name,
bool isInit =
true);
97 static SResource* GetResource(std::string name);
101 std::string m_absoluteId;
102 bool m_isInited =
false;