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