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