forked from Ares-Developers/YRpp
-
Notifications
You must be signed in to change notification settings - Fork 30
/
AbstractTypeClass.h
72 lines (59 loc) · 1.84 KB
/
AbstractTypeClass.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*
AbstractTypes are abstract template objects initialized by INI files
*/
#pragma once
#include <AbstractClass.h>
#include <Memory.h>
//forward declarations
class CCINIClass;
//Macro for the static Array of every AbstractTypeClass!
#define ABSTRACTTYPE_ARRAY(class_name, address) public:\
static constexpr constant_ptr<DynamicVectorClass<class_name*>, address> const Array{};\
static __declspec(noinline) class_name* __fastcall Find(const char* pID)\
{\
for(auto pItem : *Array)\
if(!_strcmpi(pItem->ID, pID))\
return pItem;\
return nullptr;\
}\
static __declspec(noinline) int __fastcall FindIndex(const char* pID)\
{\
for(int i = 0; i < Array->Count; ++i)\
if(!_strcmpi(Array->Items[i]->ID, pID))\
return i;\
return -1;\
}
//---
class NOVTABLE AbstractTypeClass : public AbstractClass
{
public:
static const AbstractType AbsID = AbstractType::Abstract;
//Static
static constexpr constant_ptr<DynamicVectorClass<AbstractTypeClass*>, 0xA8E968u> const Array{};
//Destructor
virtual ~AbstractTypeClass() RX;
//AbstractTypeClass
virtual void LoadTheaterSpecificArt(TheaterType th_type) RX;
virtual bool LoadFromINI(CCINIClass* pINI) R0;
virtual bool SaveToINI(CCINIClass* pINI) R0;
const char* get_ID() const {
return this->ID;
}
//Constructor
AbstractTypeClass(const char* pID) noexcept
: AbstractTypeClass(noinit_t())
{ JMP_THIS(0x410800); }
protected:
explicit __forceinline AbstractTypeClass(noinit_t) noexcept
: AbstractClass(noinit_t())
{ }
//===========================================================================
//===== Properties ==========================================================
//===========================================================================
public:
char ID [0x18];
PROTECTED_PROPERTY(BYTE, zero_3C);
char UINameLabel [0x20];
const wchar_t* UIName;
char Name [0x31];
};