1 #ifndef BTANKS_LUA_HOOKS_H__ 2 #define BTANKS_LUA_HOOKS_H__ 3 4 #include <string> 5 #include "luaxx/state.h" 6 7 class LuaHooks { 8 public: 9 LuaHooks(); 10 void load(const std::string &name); 11 void clear(); 12 13 void on_tick(const float dt); 14 void on_load(); 15 const bool on_spawn(const std::string &classname, const std::string &animation, const std::string &property); 16 void on_tooltip(const std::string &event, const int slot_id, const std::string & area, const std::string & message); 17 void on_timer(const std::string &name); 18 19 void call(const std::string &method); 20 void call1(const std::string &method, const int id); 21 22 static const std::string & getNextMap(); 23 static void resetNextMap(); 24 private: 25 26 bool check_function(const std::string &name); 27 luaxx::State state; 28 29 bool has_on_tick, has_on_spawn, has_on_load, has_on_tooltip, has_on_timer; 30 }; 31 32 #endif 33 34