14 class BGSLoadFormBuffer;
15 class BGSSaveFormBuffer;
194 std::reference_wrapper<BSReadWriteLock>>
198 return { *allForms, std::ref(*allFormsMapLock) };
204 std::reference_wrapper<BSReadWriteLock>>
208 return { *allFormsByEditorID, std::ref(*allFormsEditorIDMapLock) };
216 const auto it = map->find(a_formID);
217 return it != map->end() ? it->second :
nullptr;
227 return form ? form->As<T>() :
nullptr;
235 const auto it = map->find(a_editorID);
236 return it != map->end() ? it->second :
nullptr;
246 return form ? form->As<T>() :
nullptr;
251 class = std::enable_if_t<
255 std::is_reference<T>,
257 std::is_volatile<T>>>>>
258 [[nodiscard]] T*
As() noexcept;
262 class =
std::enable_if_t<
266 std::is_reference<T>,
268 std::is_volatile<T>>>>>
269 [[nodiscard]] const T*
As() const noexcept;
277 if (!array || array->empty()) {
281 if (a_idx < 0 ||
static_cast<std::uint32_t
>(a_idx) >= array->size()) {
282 return array->
back();
284 return (*array)[a_idx];
297 RE::FormID fileIndex = file->compileIndex << (3 * 8);
298 fileIndex += file->smallFileCompileIndex << ((1 * 8) + 4);
300 return formID & ~fileIndex;
305 [[nodiscard]]
bool HasKeywordInArray(
const std::vector<BGSKeyword*>& a_keywords,
bool a_matchAll)
const;
315 template <
class... Args>
316 [[nodiscard]]
bool Is(Args... a_args)
const noexcept
317 requires(std::same_as<Args, FormType>&&...)
319 return (
Is(a_args) || ...);
335 template <
class... Args>
336 [[nodiscard]]
bool IsNot(Args... a_args)
const noexcept
337 requires(std::same_as<Args, FormType>&&...)
339 return (
IsNot(a_args) && ...);
360 static_assert(
sizeof(
TESForm) == 0x20);
#define RELOCATION_ID(SE, AE)
Definition: PCH.h:505
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:24
TESFileArray * array
Definition: TESForm.h:31
Definition: TESObjectREFR.h:114
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:153
Definition: EffectArchetypes.h:65