aboutsummaryrefslogtreecommitdiffstats
path: root/src/script.hpp
diff options
context:
space:
mode:
authorClyne Sullivan <clyne@bitgloo.com>2019-09-16 12:46:44 -0400
committerClyne Sullivan <clyne@bitgloo.com>2019-09-16 12:46:44 -0400
commitdbb26902ed54ce308fdcec4697616e152f2894fd (patch)
tree13f6d840e6b300c10a1f6ff54051c12d9a4126e4 /src/script.hpp
parent331e858d2dd0155b54b4bf9edfbbb84d3d5a8145 (diff)
success with font loading
Diffstat (limited to 'src/script.hpp')
-rw-r--r--src/script.hpp6
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_