-
-
Notifications
You must be signed in to change notification settings - Fork 113
/
Copy pathlayout_mapping.h
99 lines (91 loc) · 2.04 KB
/
layout_mapping.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#pragma once
#include "stdafx.h"
#include "furniture_type.h"
#include "furniture_layer.h"
#include "item_list_id.h"
#include "tile_gas_type.h"
#include "creature_id.h"
#include "pretty_archive.h"
namespace LayoutActions {
using Place = FurnitureType;
using Flag = SquareAttrib;
struct RemoveFlag {
SquareAttrib SERIAL(flag);
SERIALIZE_ALL(flag)
};
enum class StairDirection;
struct Stairs {
StairDirection SERIAL(dir);
FurnitureType SERIAL(type);
int SERIAL(index);
SERIALIZE_ALL(dir, type, index)
};
struct Shop {
int SERIAL(index);
SERIALIZE_ALL(index)
};
using Items = ItemListId;
struct LayoutAction;
using Chain = vector<LayoutAction>;
using ClearFurniture = EmptyStruct<struct ClearFurniturTag>;
using ClearLayer = FurnitureLayer;
using InsideFurniture = EmptyStruct<struct InsideFurnitureTag>;
using OutsideFurniture = EmptyStruct<struct OutsideFurnitureTag>;
using AddGas = TileGasType;
struct HostileCreature {
CreatureId SERIAL(id);
SERIALIZE_ALL(id)
};
struct PeacefulCreature {
CreatureId SERIAL(id);
SERIALIZE_ALL(id)
};
struct AlliedPrisoner {
CreatureId SERIAL(id);
SERIALIZE_ALL(id)
};
struct Stockpile {
int SERIAL(index);
SERIALIZE_ALL(index)
};
struct PlaceHostile {
FurnitureType SERIAL(type);
SERIALIZE_ALL(type)
};
#define VARIANT_TYPES_LIST\
X(Place, 0)\
X(Flag, 1)\
X(RemoveFlag, 2)\
X(Stairs, 3)\
X(Chain, 4)\
X(ClearFurniture, 5)\
X(Stockpile, 6)\
X(ClearLayer, 7)\
X(OutsideFurniture, 8)\
X(InsideFurniture, 9)\
X(Items, 10)\
X(Shop, 11)\
X(PlaceHostile, 12)\
X(AddGas, 13)\
X(HostileCreature, 14)\
X(AlliedPrisoner, 15)\
X(PeacefulCreature, 16)\
#define VARIANT_NAME LayoutAction
#include "gen_variant.h"
#include "gen_variant_serialize.h"
#define DEFAULT_ELEM "Chain"
inline
#include "gen_variant_serialize_pretty.h"
#undef DEFAULT_ELEM
#undef VARIANT_TYPES_LIST
#undef VARIANT_NAME
}
using LayoutActions::LayoutAction;
struct LayoutMapping {
map<string, LayoutAction> SERIAL(actions);
SERIALIZE_ALL(actions)
};
RICH_ENUM(
LayoutActions::StairDirection,
UP, DOWN
);