X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmap%2FTrigger.h;h=086985c48a54a9bc14d20ce25a820ac462b012c5;hb=4309d259becd96ead792678257e910c03a6b4a3d;hp=f1e9cb0089c189f7eb14d921c1a13947cdc1e2a4;hpb=65f855e8181613291670bf1ef84623fabc4594d9;p=l2e.git diff --git a/src/map/Trigger.h b/src/map/Trigger.h index f1e9cb0..086985c 100644 --- a/src/map/Trigger.h +++ b/src/map/Trigger.h @@ -1,35 +1,55 @@ -/* - * Trigger.h - * - * Created on: Oct 3, 2012 - * Author: holy - */ - #ifndef MAP_TRIGGER_H_ #define MAP_TRIGGER_H_ -#include "../geometry/Vector.h" +namespace common { + class Script; +} + +#include "Entity.h" +#include "../math/Vector.h" namespace map { class Trigger { +public: + static const int TYPE_ID = 604; + public: Trigger(); ~Trigger() { } + enum Type { + TYPE_NORTH = Entity::ORIENTATION_NORTH, + TYPE_EAST = Entity::ORIENTATION_EAST, + TYPE_SOUTH = Entity::ORIENTATION_SOUTH, + TYPE_WEST = Entity::ORIENTATION_WEST, + TYPE_CONTACT = 4, + }; + public: - const geometry::Vector &TilePosition() const { return tilePosition; } + const math::Vector &TilePosition() const { return tilePosition; } + 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 SetTilePosition(const math::Vector &p) { tilePosition = p; } + void SetType(Type t) { type = t; } + void SetScript(common::Script *s) { script = s; } private: - geometry::Vector tilePosition; + common::Script *script; + math::Vector tilePosition; + int type; }; } -#endif /* MAP_TRIGGER_H_ */ +#endif