CommonLibSSE (powerof3)
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 };
25}
26
27#ifdef FMT_VERSION
28namespace fmt
29{
30 template <>
31 struct formatter<RE::ActorValue>
32 {
33 template <class ParseContext>
34 constexpr auto parse(ParseContext& a_ctx)
35 {
36 return a_ctx.begin();
37 }
38
39 template <class FormatContext>
40 auto format(const RE::ActorValue& a_actorValue, FormatContext& a_ctx)
41 {
42 auto* info = RE::ActorValueList::GetSingleton()->GetActorValue(a_actorValue);
43 return fmt::format_to(a_ctx.out(), "{}", info ? info->enumName : "None");
44 }
45 };
46}
47#endif
48
49#ifdef __cpp_lib_format
50namespace std
51{
52 template <class CharT>
53 struct formatter<RE::ActorValue, CharT> : formatter<std::string_view, CharT>
54 {
55 template <class FormatContext>
56 auto format(RE::ActorValue a_actorValue, FormatContext& a_ctx)
57 {
58 auto* info = RE::ActorValueList::GetSingleton()->GetActorValue(a_actorValue);
59 return formatter<std::string_view, CharT>::format(info ? info->enumName : "None", a_ctx);
60 }
61 };
62}
63#endif
#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