Skip to content

Commit

Permalink
Add BSResource::RHandleType helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
powerof3 committed Aug 18, 2024
1 parent 2621fd7 commit 14e3ddf
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion include/RE/B/BSResourceHandle.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<bool>(_entry);
}

[[nodiscard]] constexpr T_Entry& operator*() const noexcept
{
assert(static_cast<bool>(*this));
return *_entry;
}

[[nodiscard]] constexpr T_Entry* operator->() const noexcept
{
assert(static_cast<bool>(*this));
return _entry;
}

protected:
// members
T_Entry* entry; // 00
T_Entry* _entry; // 00
};
}

Expand Down

0 comments on commit 14e3ddf

Please sign in to comment.