diff options
Diffstat (limited to 'src/script.hpp')
-rw-r--r-- | src/script.hpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/script.hpp b/src/script.hpp index d4e2234..f86c8cd 100644 --- a/src/script.hpp +++ b/src/script.hpp @@ -45,6 +45,7 @@ private: * interactions between C and Lua */ sol::state lua; + sol::table game; entityx::EntityManager& manager; @@ -96,6 +97,11 @@ public: * Contains all calls that export components/functions to lua. */ void scriptExport(void); + + template<typename F> + void addToGameNamespace(const std::string& name, F func) { + game.set_function(name, func); + } }; #endif // SYSTEM_SCRIPT_HPP_ |