]> git.localhorst.tv Git - l2e.git/blob - src/map/Trigger.h
renamed namespace geometry -> math
[l2e.git] / src / map / Trigger.h
1 #ifndef MAP_TRIGGER_H_
2 #define MAP_TRIGGER_H_
3
4 #include "Entity.h"
5 #include "fwd.h"
6 #include "../common/Script.h"
7 #include "../math/Vector.h"
8
9 namespace map {
10
11 class Trigger {
12
13 public:
14         static const int TYPE_ID = 604;
15
16 public:
17         Trigger();
18         ~Trigger() { }
19
20         enum Type {
21                 TYPE_NORTH = Entity::ORIENTATION_NORTH,
22                 TYPE_EAST = Entity::ORIENTATION_EAST,
23                 TYPE_SOUTH = Entity::ORIENTATION_SOUTH,
24                 TYPE_WEST = Entity::ORIENTATION_WEST,
25                 TYPE_CONTACT = 4,
26         };
27
28 public:
29         const math::Vector<int> &TilePosition() const { return tilePosition; }
30         Type GetType() const { return Type(type); }
31         bool HasScript() const { return script; }
32         common::Script &GetScript() { return *script; }
33         const common::Script &GetScript() const { return *script; }
34
35         static void CreateTypeDescription();
36         static void Construct(void *);
37
38 // temporary setters
39 public:
40         void SetTilePosition(const math::Vector<int> &p) { tilePosition = p; }
41         void SetType(Type t) { type = t; }
42         void SetScript(common::Script *s) { script = s; }
43
44 private:
45         common::Script *script;
46         math::Vector<int> tilePosition;
47         int type;
48
49 };
50
51 }
52
53 #endif /* MAP_TRIGGER_H_ */