[Assets] Overload access operators to use underlying resource ptr

This commit is contained in:
SweetId 2024-03-11 17:14:39 -04:00
parent 467f471390
commit 841778fe2f
1 changed files with 5 additions and 0 deletions

View File

@ -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;