]> git.localhorst.tv Git - l2e.git/blob - src/map/Trigger.h
added Sort function to Inventory
[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         static const int TYPE_ID = 604;
22
23 public:
24         Trigger();
25         ~Trigger() { }
26
27         enum Type {
28                 TYPE_NORTH = Entity::ORIENTATION_NORTH,
29                 TYPE_EAST = Entity::ORIENTATION_EAST,
30                 TYPE_SOUTH = Entity::ORIENTATION_SOUTH,
31                 TYPE_WEST = Entity::ORIENTATION_WEST,
32                 TYPE_CONTACT = 4,
33         };
34
35 public:
36         const geometry::Vector<int> &TilePosition() const { return tilePosition; }
37         Type GetType() const { return Type(type); }
38         bool HasScript() const { return script; }
39         common::Script &GetScript() { return *script; }
40         const common::Script &GetScript() const { return *script; }
41
42         static void CreateTypeDescription();
43         static void Construct(void *);
44
45 // temporary setters
46 public:
47         void SetTilePosition(const geometry::Vector<int> &p) { tilePosition = p; }
48         void SetType(Type t) { type = t; }
49         void SetScript(common::Script *s) { script = s; }
50
51 private:
52         common::Script *script;
53         geometry::Vector<int> tilePosition;
54         int type;
55
56 };
57
58 }
59
60 #endif /* MAP_TRIGGER_H_ */