-
-
Notifications
You must be signed in to change notification settings - Fork 113
/
Copy pathfurniture_tick.h
43 lines (32 loc) · 885 Bytes
/
furniture_tick.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
#pragma once
#include "util.h"
#include "effect.h"
#include "pretty_archive.h"
class Position;
class Furniture;
namespace FurnitureTickTypes {
struct MeteorShower : EmptyStruct<struct MeteorShowerTag> {};
struct Pit : EmptyStruct<struct PitTag> {};
struct Trap {
int SERIAL(maxDistance);
array<Effect, 4> SERIAL(effects); // {south, east, north, west}
SERIALIZE_ALL(maxDistance, effects)
};
#define VARIANT_TYPES_LIST\
X(Effect, 0)\
X(MeteorShower, 1)\
X(Pit, 2)\
X(Trap, 4)
#define VARIANT_NAME FurnitureTickType
#include "gen_variant.h"
#include "gen_variant_serialize.h"
inline
#include "gen_variant_serialize_pretty.h"
#undef VARIANT_TYPES_LIST
#undef VARIANT_NAME
}
class FurnitureTickType : public FurnitureTickTypes::FurnitureTickType {
public:
using FurnitureTickTypes::FurnitureTickType::FurnitureTickType;
void handle(Position, Furniture*);
};