]> git.localhorst.tv Git - l2e.git/blob - src/map/Trigger.h
13b85ac491a08a65b5264991bc6918fa2325f385
[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,
30         };
31
32 public:
33         const geometry::Vector<int> &TilePosition() const { return tilePosition; }
34         Type GetType() const { return type; }
35         bool HasScript() const { return script; }
36         common::Script &GetScript() { return *script; }
37         const common::Script &GetScript() const { return *script; }
38
39 // temporary setters
40 public:
41         void SetTilePosition(const geometry::Vector<int> &p) { tilePosition = p; }
42         void SetType(Type t) { type = t; }
43         void SetScript(common::Script *s) { script = s; }
44
45 private:
46         common::Script *script;
47         geometry::Vector<int> tilePosition;
48         Type type;
49
50 };
51
52 }
53
54 #endif /* MAP_TRIGGER_H_ */