当前位置: 首页>>代码示例>>C++>>正文


C++ nlgeorges::UFormElm类代码示例

本文整理汇总了C++中nlgeorges::UFormElm的典型用法代码示例。如果您正苦于以下问题:C++ UFormElm类的具体用法?C++ UFormElm怎么用?C++ UFormElm使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了UFormElm类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: build

//-----------------------------------------------
// build :
// Build the sheet from an external script.
//-----------------------------------------------
void CMissionSheet::build(const NLGEORGES::UFormElm &item)
{
	// Load the descriptors.
	if(!item.getValueByName(Name, "Name"))
		debug("key 'Name' not found.");

	if(!item.getValueByName(Description, "Description"))
		debug("key 'Description' not found.");

	if(!item.getValueByName(RewardDescription, "RewardDescription"))
		debug("key 'RewardDescription' not found.");

	// load mission steps description
	for (uint i =1; i< NB_STEPS_PER_MISSION + 1;i++)
	{
		const UFormElm * stepStruct;
		string varName = string("step") + NLMISC::toString(i);
		item.getNodeByName (&stepStruct, varName.c_str());

		if (stepStruct)
		{
			string stepDesc;
			stepStruct->getValueByName(stepDesc,"Description");
			if ( !stepDesc.empty() )
				StepsDescription.push_back(stepDesc);
		}

	}
}// build //
开发者ID:CCChaos,项目名称:RyzomCore,代码行数:33,代码来源:mission_sheet.cpp

示例2: buildFogMapBuild

void CContinentParameters::buildFogMapBuild(const NLGEORGES::UFormElm &item)
{
	item.getValueByName (FogMapBuild.Map[CFogMapBuild::Day], "FogDayMap");
	item.getValueByName (FogMapBuild.Map[CFogMapBuild::Night], "FogNightMap");
	item.getValueByName (FogMapBuild.Map[CFogMapBuild::Distance], "FogDistMap");
	item.getValueByName (FogMapBuild.Map[CFogMapBuild::Depth], "FogDepthMap");
	item.getValueByName (FogMapBuild.Map[CFogMapBuild::NoPrecipitation], "NoRainMap");
	item.getValueByName (FogStart, "FogStart");
	item.getValueByName (FogEnd, "FogEnd");
	item.getValueByName (FogMapBuild.ZoneMin, "ZoneMin");
	item.getValueByName (FogMapBuild.ZoneMax, "ZoneMax");
	if (FogStart > FogEnd)
	{
		std::swap(FogStart, FogEnd);
	}
	if (!item.getValueByName (RootFogStart, "RootFogStart"))
	{
		RootFogStart = FogStart;
	}
	if (!item.getValueByName (RootFogEnd,   "RootFogEnd"))
	{
		RootFogEnd = FogEnd;
	}
	if (RootFogStart > RootFogEnd)
	{
		std::swap(RootFogStart, RootFogEnd);
	}
}
开发者ID:CCChaos,项目名称:RyzomCore,代码行数:28,代码来源:continent_sheet.cpp

示例3: importForm

void CStreamSound::importForm(const std::string &filename, NLGEORGES::UFormElm &root)
{
	// cannot do this debug check because used also by CStreamFileSound
	/*NLGEORGES::UFormElm *psoundType;
	std::string dfnName;

	// some basic checking.
	root.getNodeByName(&psoundType, ".SoundType");
	nlassert(psoundType != NULL);
	psoundType->getDfnName(dfnName);
	nlassert(dfnName == "stream_sound.dfn");*/

	// Call the base class
	CSound::importForm(filename, root);

	// MaxDistance
 	root.getValueByName(_MaxDist, ".SoundType.MaxDistance");

	// MinDistance
	root.getValueByName(_MinDist, ".SoundType.MinDistance");

	// Alpha
	root.getValueByName(m_Alpha, ".SoundType.Alpha");

#if NLSOUND_SHEET_VERSION_BUILT < 2
	_GroupController = CGroupControllerRoot::getInstance()->getGroupController(NLSOUND_SHEET_V1_DEFAULT_SOUND_STREAM_GROUP_CONTROLLER);
#endif

}
开发者ID:CCChaos,项目名称:RyzomCore,代码行数:29,代码来源:stream_sound.cpp

示例4: build

// ****************************************************************************
void COutpostSheet::build(const NLGEORGES::UFormElm &root)
{
	root.getValueByName(NbMaxSpawnedSquad, "Max Number of Spawned Squads");
	root.getValueByName(NbMaxSpawnedMercenarySquad, "Max Number of Spawned Mercenary Squads");
	root.getValueByName(ChallengeCost, "Challenge Cost");
	root.getValueByName(MaxTotalSquad, "Max Total Squads");
}
开发者ID:CCChaos,项目名称:RyzomCore,代码行数:8,代码来源:outpost_sheet.cpp

示例5: build

// ***************************************************************************************************
void CPlantInfo::build(const NLGEORGES::UFormElm &item)
{
	item.getValueByName(SheetName, "File name");
	item.getValueByName(Weight, "MicroLifeWeight");
	if (Weight == 0)
	{
		nlwarning("Plant with weight equal to 0");
	}
}
开发者ID:CCChaos,项目名称:RyzomCore,代码行数:10,代码来源:flora_sheet.cpp

示例6: build

//-----------------------------------------------
// build
//-----------------------------------------------
bool CFXStickMode::build(const NLGEORGES::UFormElm &item, const std::string &prefix /* = ""*/)
{
	bool ok = true;
	uint32 stickMode;
	ok &= item.getValueByName(stickMode, (prefix + "StickMode").c_str());
	if (ok) Mode = (CFXStickMode::TStickMode) stickMode;
	std::string userBoneName;
	ok &= item.getValueByName(userBoneName, (prefix + "UserBone").c_str());
	UserBoneName = NLMISC::CStringMapper::map(userBoneName);
	return ok;
}// build //
开发者ID:CCChaos,项目名称:RyzomCore,代码行数:14,代码来源:fx_stick_mode.cpp

示例7: build

//-----------------------------------------------
// build :
// Build the sheet from an external script.
//-----------------------------------------------
void CBuildingSheet::build(const NLGEORGES::UFormElm &item)
{
	// Load the name.
	if(!item.getValueByName(BuildedIg, "builded_ig"))
		debug("builded_ig not found.");
	if(!item.getValueByName(BuildedIcon, "builded_icon"))
		debug("builded_icon not found.");
	if(!item.getValueByName(BuildingIcon, "building_icon"))
		debug("building_icon not found.");
	if(!item.getValueByName(Name, "name"))
		debug("name not found.");
}// build //
开发者ID:mixxit,项目名称:solinia,代码行数:16,代码来源:building_sheet.cpp

示例8: build

//===============================================================================
void CWorldSheet::build(const NLGEORGES::UFormElm &item)
{
	const UFormElm *pElt;
	uint size;
	nlverify (item.getNodeByName (&pElt, "continents list"));
	if(!pElt)
	{
		nlwarning("node 'continents list' not found in a .world");
	}
	else
	{
		nlverify (pElt->getArraySize (size));
		ContLocs.reserve(size);
		for (uint32 i = 0; i <size; ++i)
		{
			const UFormElm *pEltOfList;

			// Get the continent
			if (pElt->getArrayNode (&pEltOfList, i) && pEltOfList)
			{
				SContLoc clTmp;
				clTmp.build (pEltOfList);
				ContLocs.push_back (clTmp);
			}
		}
		item.getValueByName (Name, "name");
	}

	// Maps loading
	nlverify (item.getNodeByName (&pElt, "maps list"));
	if(!pElt)
	{
		nlwarning("node 'maps list' is not found in a .world");
	}
	else
	{
		nlverify (pElt->getArraySize (size));
		Maps.reserve(size);
		for (uint32 i = 0; i < size; ++i)
		{
			const UFormElm *pEltOfList;

			// Get the continent
			if (pElt->getArrayNode (&pEltOfList, i) && pEltOfList)
			{
				SMap mapTmp;
				mapTmp.build (pEltOfList);
				Maps.push_back (mapTmp);
			}
		}
	}
}
开发者ID:CCChaos,项目名称:RyzomCore,代码行数:53,代码来源:world_sheet.cpp

示例9: build

//=============================================================================
void CWeatherFunctionSheet::build(const NLGEORGES::UFormElm &item)
{
	const NLGEORGES::UFormElm *elm;
	uint numSetups = 0;
	// get list of weather setups from the form
	if(item.getNodeByName (&elm, "WeatherSetups") && elm)
	{
		// Get number of setups
		nlverify (elm->getArraySize (numSetups));
		SetupNames.resize(numSetups);
		// For each setup
		for(uint k = 0; k < numSetups; ++k)
		{
			if (!elm->getArrayValue(SetupNames[k], k))
			{
				nlwarning("Can't read weather setup from form");
			}
		}
	}
	uint numWeights = 0;
	SetupWeights.resize(numSetups);
	// get weight of each weather setup. Setup that are not given are assumed to be 1
	if(item.getNodeByName (&elm, "SetupsWeights") && elm)
	{
		// Get number of setups
		nlverify (elm->getArraySize (numWeights));
		numWeights = std::min(numSetups, numWeights);
		// For each setup
		for(uint k = 0; k < numWeights; ++k)
		{
			if (!elm->getArrayValue(SetupWeights[k], k))
			{
				nlwarning("Can't read weather setup from form");
			}
			SetupWeights[k] = std::max((uint32) 1, SetupWeights[k]);
		}
	}
	// complete other weights if not same size
	std::fill(SetupWeights.begin() + numWeights, SetupWeights.begin() + numSetups, 1);
	//
	getWeatherFuncFormValue(item, VegetableMinBendIntensity, "Visual.VegetableMinBendIntensity");
	getWeatherFuncFormValue(item, VegetableMaxBendIntensity, "Visual.VegetableMaxBendIntensity");
	getWeatherFuncFormValue(item, VegetableMinWindFrequency, "Visual.VegetableMinWindFrequency");
	getWeatherFuncFormValue(item, VegetableMaxWindFrequency, "Visual.VegetableMaxWindFrequency");
	getWeatherFuncFormValue(item, VegetableMaxBendOffset, "Visual.VegetableMaxBendOffset");
	getWeatherFuncFormValue(item, VegetableWindIntensityThatStartBendOffset, "Visual.VegetableWindIntensityThatStartBendOffset");
	//
	getWeatherFuncFormValue(item, TreeMinWindIntensity, "Visual.TreeMinWindIntensity");
	getWeatherFuncFormValue(item, TreeMaxWindIntensity, "Visual.TreeMaxWindIntensity");

}
开发者ID:CCChaos,项目名称:RyzomCore,代码行数:52,代码来源:weather_function_sheet.cpp

示例10: build

//=======================================================
void CPlantSheet::build(const NLGEORGES::UFormElm &item)
{
	if(!(item.getValueByName(_ShapeName, "3D.Shape") &&
		 item.getValueByName(_MaxDist, "3D.MaxDist") &&
		 item.getValueByName(_CoarseMeshDist, "3D.CoarseMeshDist")))
	{
		nldebug("Key not found.");
	}

	// serial fxs by season
	SeasonFX[EGSPD::CSeason::Spring].build(item, Id, "3D.SpringFX.");
	SeasonFX[EGSPD::CSeason::Summer].build(item, Id, "3D.SummerFX.");
	SeasonFX[EGSPD::CSeason::Autumn].build(item, Id, "3D.AutomnFX.");
	SeasonFX[EGSPD::CSeason::Winter].build(item, Id, "3D.WinterFX.");
}
开发者ID:CCChaos,项目名称:RyzomCore,代码行数:16,代码来源:plant_sheet.cpp

示例11: build

//=========================================================================
void CContinentSheet::build(const NLGEORGES::UFormElm &item)
{
	Continent.build(item);
	const UFormElm *elm;
	// Load the village list
	if(item.getNodeByName (&elm, "Villages") && elm)
	{
		// Get number of village
		uint numVillage;
		nlverify (elm->getArraySize (numVillage));
		Villages.resize(numVillage);

		// For each village
		for(uint k = 0; k < numVillage; ++k)
		{
			// Village pointer
			const UFormElm *villageForm;
			if (elm->getArrayNode (&villageForm, k) && villageForm)
			{
				Villages[k].build(*villageForm);
				elm->getArrayNodeName(Villages[k].Name, k);
			}
		}
	}
	// load the weather functions
	// Build season descriptor
	static const char *seasonFuncName[] =
	{
		"SpringWeatherFunction",
		"SummerWeatherFunction",
		"AutumnWeatherFunction",
		"WinterWeatherFunction"
	};
	// added - 1 because there is an invalid season
	nlctassert(sizeof(seasonFuncName) / sizeof(seasonFuncName[0]) == EGSPD::CSeason::Invalid );

	// Load weather functions & sky sheets
	for(uint k = 0; k < EGSPD::CSeason::Invalid; ++k)
	{
		const NLGEORGES::UFormElm *elm;
		if (item.getNodeByName(&elm, seasonFuncName[k]) && elm)
		{
			WeatherFunction[k].build(*elm);
		}
	}

}
开发者ID:CCChaos,项目名称:RyzomCore,代码行数:48,代码来源:continent_sheet.cpp

示例12: nlassert

/// Load the sound parameters from georges' form
void		CContextSound::importForm(const std::string& filename, NLGEORGES::UFormElm& formRoot)
{
    NLGEORGES::UFormElm *psoundType;
    std::string dfnName;

    // some basic checking.
    formRoot.getNodeByName(&psoundType, ".SoundType");
    nlassert(psoundType != NULL);
    psoundType->getDfnName(dfnName);
    nlassert(dfnName == "context_sound.dfn");

    // Call the base class
    CSound::importForm(filename, formRoot);

    // Read the pattern name
    formRoot.getValueByName(_PatternName, ".SoundType.PatternName");
}
开发者ID:AzyxWare,项目名称:ryzom,代码行数:18,代码来源:context_sound.cpp

示例13: loadCharacteristicsFromSheet

void loadCharacteristicsFromSheet(const NLGEORGES::UFormElm &rootNode, std::string prefix, sint8 dest[CHARACTERISTICS::NUM_CHARACTERISTICS])
{
	for(uint k = 0; k < CHARACTERISTICS::NUM_CHARACTERISTICS; ++k)
	{
		const std::string &characName = CHARACTERISTICS::toString((CHARACTERISTICS::TCharacteristics) k);
		std::string characPath = prefix + characName;
		if(!rootNode.getValueByName(dest[k], characPath.c_str()))
		{
			nlwarning(("Key " + characName + "not found.").c_str());
		}
	}
}
开发者ID:CCChaos,项目名称:RyzomCore,代码行数:12,代码来源:characs_build.cpp

示例14: readEquipment

//-----------------------------------------------
// readEquipment :
// Read an equipment slot.
//-----------------------------------------------
void CCharacterSheet::readEquipment(const NLGEORGES::UFormElm &form, const string &key, CEquipment &slot)
{
	// Get the item (or shape) name.
	string itemName;
	if(!form.getValueByName(itemName, string(key + ".Item").c_str() ))
		debug(NLMISC::toString("Key '%s.Item' not found.", key.c_str()));
	slot.IdItem = ClientSheetsStrings.add(NLMISC::strlwr(itemName));

	// Get the texture.
	if(!form.getValueByName(slot.Texture, string(key + ".Texture").c_str() ))
		debug(NLMISC::toString("Key '%s.Texture' not found.", key.c_str()));

	// Get the color.
	if(!form.getValueByName(slot.Color, string(key + ".Color").c_str() ))
		debug(NLMISC::toString("Key '%s.Color' not found.", key.c_str()));

	// Get the Bind point.
	string bindPointName;
	if(!form.getValueByName(bindPointName, string(key + ".Bind Point").c_str() ))
		debug(NLMISC::toString("Key '%s.Bind Point' not found.", key.c_str()));
	slot.IdBindPoint = ClientSheetsStrings.add(bindPointName);
}// readEquipment //
开发者ID:CCChaos,项目名称:RyzomCore,代码行数:26,代码来源:character_sheet.cpp

示例15: build

//-----------------------------------------------
bool CDirLightSetup::build(const NLGEORGES::UFormElm &item)
{
	NLMISC::CRGBA amb, dif, spe;
	NLMISC::CVector dir;

	const NLGEORGES::UFormElm *pElt;
	// Light Direction
	if (item.getNodeByName (&pElt, ".Direction") && pElt)
	{
		if (!CGeorgesHelper::convert(dir, *pElt)) return false;
	}
	// Light Ambiant
	if (item.getNodeByName (&pElt, ".Ambiant") && pElt)
	{
		if (!CGeorgesHelper::convert(amb, *pElt)) return false;
	}

	// Light Diffuse
	if (item.getNodeByName (&pElt, ".Diffuse") && pElt)
	{
		if (!CGeorgesHelper::convert(dif, *pElt)) return false;
	}

	// Light Specular
	if (item.getNodeByName (&pElt, ".Specular") && pElt)
	{
		if (!CGeorgesHelper::convert(spe, *pElt)) return false;
	}

	Ambiant = amb;
	Diffuse = dif;
	Specular = spe;
	Direction = dir;

	return true;
}
开发者ID:mixxit,项目名称:solinia,代码行数:37,代码来源:dir_light_setup.cpp


注:本文中的nlgeorges::UFormElm类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。