X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmap%2FTrigger.h;h=78248589ee34fa226086840dd3702ca84614327e;hb=cc3d698b8c1ad09d7a3f9e3f28bc84e0ac1735ea;hp=222f8138f98803cc9afaa4eb75f947684b144d98;hpb=3a8e247d08c44419e632f575d2c6a919ae42a236;p=l2e.git diff --git a/src/map/Trigger.h b/src/map/Trigger.h index 222f813..7824858 100644 --- a/src/map/Trigger.h +++ b/src/map/Trigger.h @@ -1,21 +1,18 @@ -/* - * Trigger.h - * - * Created on: Oct 3, 2012 - * Author: holy - */ - #ifndef MAP_TRIGGER_H_ #define MAP_TRIGGER_H_ #include "Entity.h" #include "fwd.h" +#include "../common/Script.h" #include "../geometry/Vector.h" namespace map { class Trigger { +public: + static const int TYPE_ID = 604; + public: Trigger(); ~Trigger() { } @@ -25,26 +22,29 @@ public: TYPE_EAST = Entity::ORIENTATION_EAST, TYPE_SOUTH = Entity::ORIENTATION_SOUTH, TYPE_WEST = Entity::ORIENTATION_WEST, - TYPE_CONTACT, + TYPE_CONTACT = 4, }; public: const geometry::Vector &TilePosition() const { return tilePosition; } - Type GetType() const { return type; } + Type GetType() const { return Type(type); } + bool HasScript() const { return script; } + common::Script &GetScript() { return *script; } + const common::Script &GetScript() const { return *script; } + + static void CreateTypeDescription(); + static void Construct(void *); // temporary setters public: void SetTilePosition(const geometry::Vector &p) { tilePosition = p; } void SetType(Type t) { type = t; } + void SetScript(common::Script *s) { script = s; } private: + common::Script *script; geometry::Vector tilePosition; - Type type; - -// temporary members until scripting is implemented -public: - Map *map; - geometry::Vector target; + int type; };