Skip to content

Commit

Permalink
feat: revert rename LookupByX to GetFormByX
Browse files Browse the repository at this point in the history
  • Loading branch information
qudix committed Nov 3, 2024
1 parent 1e72d8a commit f08cbda
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion include/RE/E/Events.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ namespace RE
kLeave = 1
};

[[nodiscard]] auto GetCell() const { return TESForm::GetFormByID<TESObjectCELL>(formID); }
[[nodiscard]] auto GetCell() const { return TESForm::LookupByID<TESObjectCELL>(formID); }

[[nodiscard]] constexpr bool IsEnter() const noexcept { return type == Type::kEnter; }
[[nodiscard]] constexpr bool IsLeave() const noexcept { return type == Type::kLeave; }
Expand Down
4 changes: 2 additions & 2 deletions include/RE/IDs.h
Original file line number Diff line number Diff line change
Expand Up @@ -527,8 +527,8 @@ namespace RE::ID
{
inline constexpr REL::ID DecExternalRefCount{ 34165 };
inline constexpr REL::ID DecRefCount{ 35164 };
inline constexpr REL::ID GetFormByID{ 86125 };
inline constexpr REL::ID GetFormByEditorID{ 86123 };
inline constexpr REL::ID LookupByID{ 86125 };
inline constexpr REL::ID LookupByEditorID{ 86123 };
}

namespace TESNPC
Expand Down
16 changes: 8 additions & 8 deletions include/RE/T/TESForm.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,31 +159,31 @@ namespace RE
return func(this);
}

[[nodiscard]] static TESForm* GetFormByID(TESFormID a_formID)
[[nodiscard]] static TESForm* LookupByID(TESFormID a_formID)
{
using func_t = TESForm* (*)(TESFormID);
static REL::Relocation<func_t> func{ ID::TESForm::GetFormByID };
static REL::Relocation<func_t> func{ ID::TESForm::LookupByID };
return func(a_formID);
}

template <class T>
[[nodiscard]] static T* GetFormByID(TESFormID a_formID)
[[nodiscard]] static T* LookupByID(TESFormID a_formID)
{
const auto form = GetFormByID(a_formID);
const auto form = LookupByID(a_formID);
return form ? form->As<T>() : nullptr;
}

[[nodiscard]] static TESForm* GetFormByEditorID(const BSFixedString& a_editorID)
[[nodiscard]] static TESForm* LookupByEditorID(const BSFixedString& a_editorID)
{
using func_t = TESForm* (*)(const BSFixedString&);
static REL::Relocation<func_t> func{ ID::TESForm::GetFormByEditorID };
static REL::Relocation<func_t> func{ ID::TESForm::LookupByEditorID };
return func(a_editorID);
}

template <class T>
[[nodiscard]] static T* GetFormByEditorID(const BSFixedString& a_editorID)
[[nodiscard]] static T* LookupByEditorID(const BSFixedString& a_editorID)
{
const auto form = GetFormByEditorID(a_editorID);
const auto form = LookupByEditorID(a_editorID);
return form ? form->As<T>() : nullptr;
}

Expand Down

0 comments on commit f08cbda

Please sign in to comment.