]> git.localhorst.tv Git - l2e.git/blobdiff - src/map/MapState.h
use scripts for map triggers
[l2e.git] / src / map / MapState.h
index bf19f4d5d315b0e8750d0e544588a336083f59cd..952bcee393d242cca8d73cdf793c23f5afba062e 100644 (file)
@@ -12,6 +12,8 @@
 #include "fwd.h"
 #include "../app/State.h"
 #include "../common/fwd.h"
+#include "../common/ScriptHost.h"
+#include "../common/ScriptRunner.h"
 #include "../geometry/Vector.h"
 #include "../graphics/Camera.h"
 
@@ -20,7 +22,8 @@
 namespace map {
 
 class MapState
-: public app::State {
+: public app::State
+, public common::ScriptHost {
 
 public:
        explicit MapState(common::GameConfig *, Map *);
@@ -45,6 +48,8 @@ public:
 
        void Transition(Map *, const geometry::Vector<int> &coordinates);
 
+       virtual void HandleSyscall(common::ScriptRunner &);
+
 private:
        static bool ZCompare(const Entity *lhs, const Entity *rhs);
 
@@ -68,12 +73,18 @@ private:
        bool CheckMoveTrigger();
        void RunTrigger(Trigger &);
 
+       enum Syscalls {
+               TRANSITION = 1,
+               WARP = 2,
+       };
+
 private:
        common::GameConfig *game;
        app::Application *ctrl;
        Map *map;
        Entity *controlled;
        Entity *pushed;
+       common::ScriptRunner runner;
        app::Timer<float> moveTimer;
        geometry::Vector<int> lastLock;
        graphics::Camera camera;