Exemple #1
0
int BlockLuaMetaData::Index(lua_State * L, const BlockPtr & ptr,
									  const std::string & index)
{
	if (index == "Code")
	{
		lua_pushstring(L, ptr->GetCode().c_str());
		return 1;
	}
	else if (index == "Id")
	{
		lua_pushstring(L, ptr->GetId().c_str());
		return 1;
	}
	else if (index == "ImportedNodes")
	{
		luaL_error(L, "Not implemented currently.");
		// NodeListPtr list = ptr->GetImportedNodes();
		// NodeListLuaMetaData::PutInstanceOnStack(L, list);
		return 1;
	}
	return 0;
}