[Assets] Overload access operators to use underlying resource ptr
This commit is contained in:
parent
467f471390
commit
841778fe2f
|
|
@ -11,6 +11,11 @@ namespace Nz
|
|||
const std::shared_ptr<TResource>& Get() const { return m_resource; }
|
||||
explicit operator bool() const noexcept { return !!m_resource; }
|
||||
|
||||
TResource& operator*() { return *m_resource.get(); }
|
||||
const TResource& operator*() const { return *m_resource.get(); }
|
||||
TResource* operator->() { return m_resource.get(); }
|
||||
const TResource* operator->() const { return m_resource.get(); }
|
||||
|
||||
protected:
|
||||
AssetDescriptor<TResource> m_descriptor;
|
||||
std::shared_ptr<TResource> m_resource;
|
||||
|
|
|
|||
Loading…
Reference in New Issue