14 class BGSLoadFormBuffer;
15 class BGSSaveFormBuffer;
193 std::reference_wrapper<BSReadWriteLock>>
197 return { *allForms, std::ref(*allFormsMapLock) };
203 std::reference_wrapper<BSReadWriteLock>>
207 return { *allFormsByEditorID, std::ref(*allFormsEditorIDMapLock) };
215 const auto it = map->find(a_formID);
216 return it != map->end() ? it->second :
nullptr;
226 return form ? form->As<T>() :
nullptr;
234 const auto it = map->find(a_editorID);
235 return it != map->end() ? it->second :
nullptr;
245 return form ? form->As<T>() :
nullptr;
250 class = std::enable_if_t<
254 std::is_reference<T>,
256 std::is_volatile<T>>>>>
257 [[nodiscard]] T*
As() noexcept;
261 class =
std::enable_if_t<
265 std::is_reference<T>,
267 std::is_volatile<T>>>>>
268 [[nodiscard]] const T*
As() const noexcept;
276 if (!array || array->empty()) {
280 if (a_idx < 0 ||
static_cast<std::uint32_t
>(a_idx) >= array->size()) {
281 return array->
back();
283 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(a_se, a_ae)
Definition: PCH.h:724
Definition: Relocation.h:204
Definition: BSAtomic.h:71
Definition: BSTArray.h:656
constexpr reference back() noexcept
Definition: BSTArray.h:682
Definition: BSTHashMap.h:21
Definition: TESBoundObject.h:24
TESFileArray * array
Definition: TESForm.h:31
Definition: TESObjectREFR.h:113
requires(is_builtin_convertible_v< T >) struct GetRawType< T >
Definition: PackUnpack.h:30
Definition: AbsorbEffect.h:6
FormType
Definition: FormTypes.h:139
std::uint32_t FormID
Definition: BSCoreTypes.h:5
constexpr REL::VariantID RTTI_TESForm(513848, 392216, 0x1ed6d20)
Definition: ActorValueList.h:28