-
-
Notifications
You must be signed in to change notification settings - Fork 132
Expand file tree
/
Copy pathBody.h
More file actions
60 lines (46 loc) · 1.59 KB
/
Body.h
File metadata and controls
60 lines (46 loc) · 1.59 KB
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
#pragma once
#include <OverlayTypeClass.h>
#include <Utilities/Container.h>
#include <Utilities/TemplateDef.h>
class OverlayTypeExt
{
public:
using base_type = OverlayTypeClass;
static constexpr DWORD Canary = 0xADF48498;
static constexpr size_t ExtPointerOffset = 0x18;
class ExtData final : public Extension<OverlayTypeClass>
{
public:
Valueable<bool> CanBeBuiltOn;
Valueable<bool> CanBeBuiltOn_Remove;
Valueable<int> ZAdjust;
PhobosFixedString<32u> PaletteFile;
DynamicVectorClass<ColorScheme*>* Palette; // Intentionally not serialized - rebuilt from the palette file on load.
ExtData(OverlayTypeClass* OwnerObject) : Extension<OverlayTypeClass>(OwnerObject)
, CanBeBuiltOn { false }
, CanBeBuiltOn_Remove { true }
, ZAdjust { 0 }
, PaletteFile {}
, Palette {}
{ }
virtual ~ExtData() = default;
virtual void LoadFromINIFile(CCINIClass* pINI) override;
virtual void InvalidatePointer(void* ptr, bool bRemoved) override { }
virtual void LoadFromStream(PhobosStreamReader& Stm) override;
virtual void SaveToStream(PhobosStreamWriter& Stm) override;
private:
template <typename T>
void Serialize(T& Stm);
};
class ExtContainer final : public Container<OverlayTypeExt>
{
public:
ExtContainer();
~ExtContainer();
};
static ExtContainer ExtMap;
static bool LoadGlobals(PhobosStreamReader& Stm);
static bool SaveGlobals(PhobosStreamWriter& Stm);
static bool CanBeBuiltOn(int overlayTypeIndex, BuildingTypeClass* pBuildingType, bool requireToBeRemovable);
static void RemoveOverlayFromCell(int overlayTypeIndex, CellClass* pCell, HouseClass* pSource);
};