CommonLibSSE (powerof3)
NiExtraData.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/B/BSFixedString.h"
4 #include "RE/N/NiObject.h"
5 
6 namespace RE
7 {
8  class NiExtraData : public NiObject
9  {
10  public:
11  inline static constexpr auto RTTI = RTTI_NiExtraData;
12  inline static constexpr auto Ni_RTTI = NiRTTI_NiExtraData;
13  inline static constexpr auto VTABLE = VTABLE_NiExtraData;
14 
15  ~NiExtraData() override; // 00
16 
17  // override (NiObject)
18  const NiRTTI* GetRTTI() const override; // 02
19  void LoadBinary(NiStream& a_stream) override; // 18
20  void LinkObject(NiStream& a_stream) override; // 19 - { return; }
21  bool RegisterStreamables(NiStream& a_stream) override; // 1A
22  void SaveBinary(NiStream& a_stream) override; // 1B
23  bool IsEqual(NiObject* a_object) override; // 1C
24 
25  // add
26  [[nodiscard]] virtual bool IsStreamable() const; // 25 - { return true; }
27  [[nodiscard]] virtual bool IsCloneable() const; // 26 - { return true; }
28 
29  static NiExtraData* Create(std::size_t a_size, std::uintptr_t a_vtbl);
30  template <class T>
31  static T* Create();
32 
33  [[nodiscard]] const BSFixedString& GetName() const;
34  void SetName(const BSFixedString& a_name);
35 
36  // members
38  };
39  static_assert(sizeof(NiExtraData) == 0x18);
40 
41  template <class T>
43  {
44  return static_cast<T*>(Create(sizeof(T), T::VTABLE[0].address()));
45  }
46 }
Definition: NiExtraData.h:9
static T * Create()
Definition: NiExtraData.h:42
const BSFixedString & GetName() const
bool RegisterStreamables(NiStream &a_stream) override
virtual bool IsCloneable() const
void SaveBinary(NiStream &a_stream) override
void LoadBinary(NiStream &a_stream) override
~NiExtraData() override
BSFixedString name
Definition: NiExtraData.h:37
void SetName(const BSFixedString &a_name)
const NiRTTI * GetRTTI() const override
static constexpr auto RTTI
Definition: NiExtraData.h:11
bool IsEqual(NiObject *a_object) override
static constexpr auto VTABLE
Definition: NiExtraData.h:13
void LinkObject(NiStream &a_stream) override
static constexpr auto Ni_RTTI
Definition: NiExtraData.h:12
virtual bool IsStreamable() const
static NiExtraData * Create(std::size_t a_size, std::uintptr_t a_vtbl)
Definition: NiObject.h:37
Definition: NiRTTI.h:6
Definition: NiStream.h:29
Definition: AbsorbEffect.h:6
constexpr REL::ID RTTI_NiExtraData(static_cast< std::uint64_t >(684976))
constexpr std::array< REL::ID, 1 > VTABLE_NiExtraData
Definition: Offsets_VTABLE.h:12201
constexpr REL::ID NiRTTI_NiExtraData(static_cast< std::uint64_t >(523948))