14 class BGSLoadFormBuffer;
15 class BGSSaveFormBuffer;
198 std::reference_wrapper<BSReadWriteLock>>
202 return { *allForms, std::ref(*allFormsMapLock) };
208 std::reference_wrapper<BSReadWriteLock>>
212 return { *allFormsByEditorID, std::ref(*allFormsEditorIDMapLock) };
220 const auto it = map->find(a_formID);
221 return it != map->end() ? it->second :
nullptr;
231 return form ? form->As<T>() :
nullptr;
239 const auto it = map->find(a_editorID);
240 return it != map->end() ? it->second :
nullptr;
250 return form ? form->As<T>() :
nullptr;
255 class = std::enable_if_t<
259 std::is_reference<T>,
261 std::is_volatile<T>>>>>
262 [[nodiscard]] T*
As() noexcept;
266 class =
std::enable_if_t<
270 std::is_reference<T>,
272 std::is_volatile<T>>>>>
273 [[nodiscard]] const T*
As() const noexcept;
281 if (!array || array->empty()) {
285 if (a_idx < 0 ||
static_cast<std::uint32_t
>(a_idx) >= array->size()) {
286 return array->
back();
288 return (*array)[a_idx];
301 RE::FormID fileIndex = file->compileIndex << (3 * 8);
302 fileIndex += file->smallFileCompileIndex << ((1 * 8) + 4);
304 return formID & ~fileIndex;
309 [[nodiscard]]
bool HasKeywordInArray(
const std::vector<BGSKeyword*>& a_keywords,
bool a_matchAll)
const;
319 template <
class... Args>
320 [[nodiscard]]
bool Is(Args... a_args)
const noexcept
321 requires(std::same_as<Args, FormType>&&...)
323 return (
Is(a_args) || ...);
339 template <
class... Args>
340 [[nodiscard]]
bool IsNot(Args... a_args)
const noexcept
341 requires(std::same_as<Args, FormType>&&...)
343 return (
IsNot(a_args) && ...);
366 static_assert(
sizeof(
TESForm) == 0x20);
#define KEEP_FOR_RE()
Definition: PCH.h:713
#define RELOCATION_ID(SE, AE)
Definition: PCH.h:702
Definition: Relocation.h:210
Definition: BSAtomic.h:112
Definition: BSTArray.h:657
constexpr reference back() noexcept
Definition: BSTArray.h:683
Definition: BSTHashMap.h:21
Definition: TESBoundObject.h:26
TESFileArray * array
Definition: TESForm.h:33
Definition: TESObjectREFR.h:113
Definition: AbsorbEffect.h:6
constexpr std::array< REL::ID, 1 > VTABLE_TESForm
Definition: Offsets_VTABLE.h:12827
constexpr REL::ID RTTI_TESForm(static_cast< std::uint64_t >(513848))
FormType
Definition: FormTypes.h:139
std::uint32_t FormID
Definition: BSCoreTypes.h:5
requires(std::invocable< std::remove_reference_t< EF >>) class scope_exit
Definition: PCH.h:151
Definition: EffectArchetypes.h:65