diff --git a/include/RE/B/BSResourceHandle.h b/include/RE/B/BSResourceHandle.h index 76b8e0651..51152e57f 100644 --- a/include/RE/B/BSResourceHandle.h +++ b/include/RE/B/BSResourceHandle.h @@ -21,8 +21,31 @@ namespace RE using U_Entry = T_Entry; using U_EntryDB = T_EntryDB; + [[nodiscard]] constexpr T_Entry* get() const noexcept + { + return _entry; + } + + [[nodiscard]] explicit constexpr operator bool() const noexcept + { + return static_cast(_entry); + } + + [[nodiscard]] constexpr T_Entry& operator*() const noexcept + { + assert(static_cast(*this)); + return *_entry; + } + + [[nodiscard]] constexpr T_Entry* operator->() const noexcept + { + assert(static_cast(*this)); + return _entry; + } + + protected: // members - T_Entry* entry; // 00 + T_Entry* _entry; // 00 }; }