summaryrefslogtreecommitdiff
path: root/includes/LuaHandle.h
blob: fcde49613d3b9f7574444dc77c9c55c6aecc8820 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#pragma once

#include <BLua.h>
#include <Handle.h>
#include <Input.h>

namespace Balau {

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 &);

};