push deques into lua
This commit is contained in:
parent
80e4bb59d2
commit
6737b0a492
|
@ -71,6 +71,7 @@ void LuaInterface::registerFunctions()
|
|||
g_lua.bindClassMemberFunction<UIWidget>("show", &UIWidget::show);
|
||||
g_lua.bindClassMemberFunction<UIWidget>("lock", &UIWidget::lock);
|
||||
g_lua.bindClassMemberFunction<UIWidget>("unlock", &UIWidget::unlock);
|
||||
g_lua.bindClassMemberFunction<UIWidget>("getChildren", &UIWidget::getChildren);
|
||||
g_lua.bindClassMemberFunction<UIWidget>("getChildById", &UIWidget::getChildById);
|
||||
g_lua.bindClassMemberFunction<UIWidget>("getChildByIndex", &UIWidget::getChildByIndex);
|
||||
g_lua.bindClassMemberFunction<UIWidget>("getChildCount", &UIWidget::getChildCount);
|
||||
|
|
|
@ -102,6 +102,10 @@ luavalue_cast(int index, std::function<Ret(Args...)>& func);
|
|||
template<typename T>
|
||||
void push_luavalue(const std::vector<T>& vec);
|
||||
|
||||
// deque
|
||||
template<class T>
|
||||
void push_luavalue(const std::deque<T>& vec);
|
||||
|
||||
// tuple
|
||||
template<typename... Args>
|
||||
void push_luavalue(const std::tuple<Args...>& tuple);
|
||||
|
@ -222,6 +226,17 @@ void push_luavalue(const std::vector<T>& vec) {
|
|||
}
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void push_luavalue(const std::deque<T>& vec) {
|
||||
g_lua.newTable();
|
||||
int i = 1;
|
||||
for(const T& v : vec) {
|
||||
push_luavalue(v);
|
||||
g_lua.rawSeti(i);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
template<int N>
|
||||
struct push_tuple_luavalue {
|
||||
template<typename Tuple>
|
||||
|
|
Loading…
Reference in New Issue