forked from CleverRaven/Cataclysm-DDA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathenums.h
63 lines (55 loc) · 1.38 KB
/
enums.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
#ifndef _ENUMS_H_
#define _ENUMS_H_
#ifndef sgn
#define sgn(x) (((x) < 0) ? -1 : 1)
#endif
enum phase_id {
PNULL, SOLID, LIQUID, GAS, PLASMA
};
// Return the class an in-world object uses to interact with the world.
// ex; if ( player.grab_type == OBJECT_VEHICLE ) { ...
// or; if ( baseactor_just_shot_at.object_type() == OBJECT_NPC ) { ...
enum object_type {
OBJECT_NONE, // Nothing, invalid.
OBJECT_ITEM, // item.h
OBJECT_ACTOR, // potential virtual base class, get_object_type() would return one of the types below
OBJECT_PLAYER, // player.h, npc.h
OBJECT_NPC, // nph.h
OBJECT_MONSTER, // monster.h
OBJECT_VEHICLE, // vehicle.h
OBJECT_TRAP, // trap.h
OBJECT_FIELD, // field.h; field_entry
OBJECT_TERRAIN, // Not a real object
OBJECT_FURNITURE, // Not a real object
NUM_OBJECTS,
};
enum damage_type
{
DNULL = 0,
BASH,
CUT,
ACID,
ELECTRICITY,
FIRE,
NUM_DAM_TYPES
};
struct point {
int x;
int y;
point(int X = 0, int Y = 0) : x (X), y (Y) {}
point(const point &p) : x (p.x), y (p.y) {}
~point(){}
};
inline bool operator<(const point& a, const point& b)
{
return a.x < b.x || (a.x == b.x && a.y < b.y);
}
struct tripoint {
int x;
int y;
int z;
tripoint(int X = 0, int Y = 0, int Z = 0) : x (X), y (Y), z (Z) {}
tripoint(const tripoint &p) : x (p.x), y (p.y), z (p.z) {}
~tripoint(){}
};
#endif