Exemplo n.º 1
0
void LuaTable::setReference(const LuaReference& ref) {
	ref->pushValue();

	lua_State* L = ref->getState();

	if (lua_type(L, -1) != LUA_TTABLE) {
		lua_pop(L, 1);
		throw LuaException("Reference does not refere to a table!");
	} else {
		lua_pop(L, 1);
		LuaValue::setReference(ref);
	}
}
Exemplo n.º 2
0
void LuaFunction::setReference(LuaReference ref) {
	ref->pushValue();

	lua_State* L = ref->getState();

	if (lua_type(L, -1) != LUA_TFUNCTION) {
		lua_pop(L, 1);
		throw LuaException("Reference does not refere to a function!");
	} else {
		lua_pop(L, 1);
		LuaValue::setReference(ref);
	}
}
Exemplo n.º 3
0
LuaReference UniqueLuaReference::copy(const LuaReference& other) {
	other->pushValue();

	return create(other->_luaState);
}