diff options
Diffstat (limited to 'includes')
-rw-r--r-- | includes/LuaHandle.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/includes/LuaHandle.h b/includes/LuaHandle.h new file mode 100644 index 0000000..ab165ee --- /dev/null +++ b/includes/LuaHandle.h @@ -0,0 +1,33 @@ +#pragma once + +#include <BLua.h> +#include <Handle.h> +#include <Input.h> + +namespace Balau { + +typedef IO<Handle> IOHandle; +typedef IOHandle IOInput; + +class LuaHandleFactory : public LuaObjectFactory { + public: + LuaHandleFactory(IO<Handle> h) : m_obj(new IO<Handle>(h)) { } + static void pushStatics(Lua & L); + protected: + LuaHandleFactory(IO<Handle> * h) : m_obj(h) { } + void pushObjectAndMembers(Lua & L); + private: + IO<Handle> * m_obj; +}; + +class LuaInputFactory : public LuaHandleFactory { + public: + LuaInputFactory(IO<Input> h) : LuaHandleFactory(new IO<Handle>(h)) { } + static void pushStatics(Lua & L); + private: + void pushObjectAndMembers(Lua & L); +}; + +void registerLuaHandle(Lua &); + +}; |