CommonLibVR
ExtraLock.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/B/BSExtraData.h"
4 #include "RE/E/ExtraDataTypes.h"
5 #include "RE/F/FormTypes.h"
6 
7 namespace RE
8 {
9  enum class LOCK_LEVEL
10  {
11  kUnlocked = static_cast<std::underlying_type_t<LOCK_LEVEL>>(-1),
12  kVeryEasy = 0,
13  kEasy = 1,
14  kAverage = 2,
15  kHard = 3,
16  kVeryHard = 4,
17  kRequiresKey = 5
18  };
19 
20  struct REFR_LOCK
21  {
22  enum class Flag
23  {
24  kNone = 0,
25  kLocked = 1 << 0,
26  kLeveled = 1 << 2
27  };
28 
29  LOCK_LEVEL GetLockLevel(const TESObjectREFR* a_containerRef) const;
30  [[nodiscard]] constexpr bool IsLocked() const noexcept { return flags.all(Flag::kLocked); }
31  void SetLocked(bool a_locked);
32 
33  // members
34  std::int8_t baseLevel; // 00
35  std::uint8_t pad01; // 01
36  std::uint16_t pad02; // 02
37  std::uint32_t pad04; // 04
38  TESKey* key; // 08
40  std::uint8_t pad11; // 11
41  std::uint16_t pad12; // 12
42  std::uint32_t numTries; // 14
43  std::uint32_t unk18; // 18
44  std::uint32_t pad1C; // 1C
45  };
46  static_assert(sizeof(REFR_LOCK) == 0x20);
47 
48  class ExtraLock : public BSExtraData
49  {
50  public:
51  inline static constexpr auto RTTI = RTTI_ExtraLock;
52  inline static constexpr auto VTABLE = VTABLE_ExtraLock;
53  inline static constexpr auto EXTRADATATYPE = ExtraDataType::kLock;
54 
55  ~ExtraLock() override; // 00
56 
57  // override (BSExtraData)
58  ExtraDataType GetType() const override; // 01 - { return kLock; }
59  bool IsNotEqual(const BSExtraData* a_rhs) const override; // 02
60 
61  // members
62  REFR_LOCK* lock; // 10
63  private:
64  KEEP_FOR_RE()
65  };
66  static_assert(sizeof(ExtraLock) == 0x18);
67 }
#define KEEP_FOR_RE()
Definition: PCH.h:713
Definition: BSExtraData.h:9
Definition: ExtraLock.h:49
static constexpr auto RTTI
Definition: ExtraLock.h:51
bool IsNotEqual(const BSExtraData *a_rhs) const override
~ExtraLock() override
static constexpr auto VTABLE
Definition: ExtraLock.h:52
ExtraDataType GetType() const override
REFR_LOCK * lock
Definition: ExtraLock.h:62
static constexpr auto EXTRADATATYPE
Definition: ExtraLock.h:53
Definition: TESKey.h:9
Definition: TESObjectREFR.h:113
constexpr bool all(Args... a_args) const noexcept requires(std
Definition: PCH.h:290
Definition: AbsorbEffect.h:6
constexpr std::array< REL::ID, 1 > VTABLE_ExtraLock
Definition: Offsets_VTABLE.h:11563
LOCK_LEVEL
Definition: ExtraLock.h:10
ExtraDataType
Definition: ExtraDataTypes.h:173
constexpr REL::ID RTTI_ExtraLock(static_cast< std::uint64_t >(684644))
Definition: ExtraLock.h:21
std::uint32_t numTries
Definition: ExtraLock.h:42
std::uint8_t pad11
Definition: ExtraLock.h:40
std::uint32_t pad1C
Definition: ExtraLock.h:44
TESKey * key
Definition: ExtraLock.h:38
std::uint32_t pad04
Definition: ExtraLock.h:37
void SetLocked(bool a_locked)
std::uint16_t pad02
Definition: ExtraLock.h:36
stl::enumeration< Flag, std::uint8_t > flags
Definition: ExtraLock.h:39
std::uint8_t pad01
Definition: ExtraLock.h:35
std::uint16_t pad12
Definition: ExtraLock.h:41
std::int8_t baseLevel
Definition: ExtraLock.h:34
constexpr bool IsLocked() const noexcept
Definition: ExtraLock.h:30
std::uint32_t unk18
Definition: ExtraLock.h:43
Flag
Definition: ExtraLock.h:23
LOCK_LEVEL GetLockLevel(const TESObjectREFR *a_containerRef) const