From b7f37f6426c78132d338b032962209bd93771039 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Mon, 20 Nov 2023 13:02:29 +1100 Subject: Add a generic lua function binding, alongside properties --- src/lua/include/property.hpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/lua/include/property.hpp') diff --git a/src/lua/include/property.hpp b/src/lua/include/property.hpp index b6b4718f..60f9906a 100644 --- a/src/lua/include/property.hpp +++ b/src/lua/include/property.hpp @@ -16,6 +16,7 @@ namespace lua { using LuaValue = std::variant; +using LuaFunction = std::function; class Property { public: @@ -42,6 +43,12 @@ class PropertyBindings { PropertyBindings(lua_State&); auto Register(lua_State*, Property*) -> void; + auto Register(lua_State*, LuaFunction) -> void; + + auto GetFunction(size_t i) -> const LuaFunction&; + + private: + std::vector functions_; }; } // namespace lua -- cgit v1.2.3