Ref<T> Get(unsigned int i);
Ref<T> Get(const char* id);
- bool Has(const char* id);
-
Ref<T> Create(const char* id);
Ref<T> Create(const std::string& id)
{ return Create(id.c_str()); }
return Ref<T>(mObjs, it->second);
}
- return Create(id);
-}
-
-template<class T>
-bool LazyDict<T>::Has(const char* id)
-{
- id = T::TranslateId(mAsset, id);
-
- typename IdDict::iterator it = mObjsById.find(id);
-
- return it != mObjsById.end();
+ return Ref<T>();
}
template<class T>
id = aId.C_Str();
}
- if (mAsset->samplers.Has(id.c_str())) {
- texture->sampler = mAsset->samplers.Get(id.c_str());
+ if (Ref<Sampler> ref = mAsset->samplers.Get(id.c_str())) {
+ texture->sampler = ref;
} else {
id = mAsset->FindUniqueID(id, "sampler");