Пример #1
0
static void _add_children_to_sbody(lua_State* L, CustomSBody* sbody, OOLUA::Lua_table children)
{
	int i=1;
	while (1) {
		CustomSBody *kid;

		if (!children.safe_at(i++, kid))
			break;

		if (kid == NULL) {
			luaL_error(L,
				"invalid element (must be CustomSBody or table of CustomSBody)\n"
				"invalid element is child of CustomSBody '%s'", sbody->name.c_str());
		}

		while (1) {
			OOLUA::Lua_table sub;

			if (!children.safe_at(i, sub))
				break;

			if (!sub.valid())
				break;

			_add_children_to_sbody(L, kid, sub);
			i++;
			continue;
		}

		sbody->children.push_back(*kid);
	}
}
Пример #2
0
	void copyConstruct_usingNewTable_orginalIsValid()
	{
		OOLUA::Lua_table orignal;
		OOLUA::new_table(*m_lua,orignal);
		OOLUA::Lua_table copy(orignal);

		CPPUNIT_ASSERT_EQUAL(true, orignal.valid() );
	}
Пример #3
0
	void newTable_fromCplusplus_validReturnsTrue()
	{
		OOLUA::Lua_table t;
		OOLUA::new_table(*m_lua,t);
		CPPUNIT_ASSERT_EQUAL(true,t.valid() );
	}