CommonLibVR
Loading...
Searching...
No Matches
ActorValueList.h
Go to the documentation of this file.
1#pragma once
2
4#include "RE/A/ActorValues.h"
5
6namespace RE
7{
9 {
10 public:
11 [[nodiscard]] static ActorValueList* GetSingleton()
12 {
13 static REL::Relocation<ActorValueList**> singleton{ RELOCATION_ID(514139, 400267) };
14 return *singleton;
15 }
16
17 [[nodiscard]] ActorValueInfo* GetActorValue(ActorValue a_actorValue) const;
18 [[nodiscard]] ActorValue LookupActorValueByName(std::string_view a_enumName) const;
19
20 // members
21 std::uint32_t unk00; // 00
22 std::uint32_t pad04; // 04
23 ActorValueInfo* actorValues[std::to_underlying(ActorValue::kTotal)]; // 08
24 private:
26 };
27}
28
29#ifdef FMT_VERSION
30namespace fmt
31{
32 template <>
33 struct formatter<RE::ActorValue>
34 {
35 template <class ParseContext>
36 constexpr auto parse(ParseContext& a_ctx)
37 {
38 return a_ctx.begin();
39 }
40
41 template <class FormatContext>
42 auto format(const RE::ActorValue& a_actorValue, FormatContext& a_ctx)
43 {
44 auto* info = RE::ActorValueList::GetSingleton()->GetActorValue(a_actorValue);
45 return fmt::format_to(a_ctx.out(), "{}", info ? info->enumName : "None");
46 }
47 };
48}
49#endif
50
51#ifdef __cpp_lib_format
52namespace std
53{
54 template <class CharT>
55 struct formatter<RE::ActorValue, CharT> : formatter<std::string_view, CharT>
56 {
57 template <class FormatContext>
58 auto format(RE::ActorValue a_actorValue, FormatContext& a_ctx)
59 {
60 auto* info = RE::ActorValueList::GetSingleton()->GetActorValue(a_actorValue);
61 return formatter<std::string_view, CharT>::format(info ? info->enumName : "None", a_ctx);
62 }
63 };
64}
65#endif
#define KEEP_FOR_RE()
Definition PCH.h:517
#define RELOCATION_ID(SE, AE)
Definition PCH.h:506
Definition Relocation.h:210
Definition ActorValueInfo.h:20
Definition ActorValueList.h:9
ActorValue LookupActorValueByName(std::string_view a_enumName) const
std::uint32_t unk00
Definition ActorValueList.h:21
ActorValueInfo * GetActorValue(ActorValue a_actorValue) const
static ActorValueList * GetSingleton()
Definition ActorValueList.h:11
ActorValueInfo * actorValues[std::to_underlying(ActorValue::kTotal)]
Definition ActorValueList.h:23
std::uint32_t pad04
Definition ActorValueList.h:22
Definition AbsorbEffect.h:6
ActorValue
Definition ActorValues.h:6
Definition EffectArchetypes.h:65