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


C++ XmlNodeRef::getParent方法代码示例

本文整理汇总了C++中XmlNodeRef::getParent方法的典型用法代码示例。如果您正苦于以下问题:C++ XmlNodeRef::getParent方法的具体用法?C++ XmlNodeRef::getParent怎么用?C++ XmlNodeRef::getParent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在XmlNodeRef的用法示例。


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

示例1: InitModification

void CVehicleModificationParams::InitModification( XmlNodeRef xmlModificationData )
{
	assert( xmlModificationData );

	bool hasParentModification = xmlModificationData->haveAttr( "parent" );
	if ( hasParentModification )
	{
		XmlNodeRef xmlModificationsGroup = xmlModificationData->getParent();

		const char* parentModificationName = xmlModificationData->getAttr( "parent" );
		XmlNodeRef xmlParentModificationData = FindModificationNodeByName( parentModificationName, xmlModificationsGroup );
		if ( xmlParentModificationData && ( xmlParentModificationData != xmlModificationData ) )
		{
			InitModification( xmlParentModificationData );
		}
	}

	XmlNodeRef xmlElemsGroup = xmlModificationData->findChild( "Elems" );
	if ( ! xmlElemsGroup )
	{
		return;
	}

	for ( int i = 0; i < xmlElemsGroup->getChildCount(); ++i )
	{
		XmlNodeRef xmlElem = xmlElemsGroup->getChild( i );

		InitModificationElem( xmlElem );
	}
}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:30,代码来源:VehicleModificationParams.cpp

示例2: Reset


//.........这里部分代码省略.........

	if (paramsNode)
	{
		CGameXmlParamReader reader(paramsNode);

		suffix = reader.ReadParamValue("suffix", suffix.c_str());
		suffixAG = reader.ReadParamValue("suffixAG", suffixAG.c_str());
		tag = reader.ReadParamValue("tag", tag.c_str());
		reader.ReadParamValue<short>("rate", rate);
		reader.ReadParamValue<short>("fake_fire_rate", fake_fire_rate);
		reader.ReadParamValue<short>("minimum_ammo_count", minimum_ammo_count);
		reader.ReadParamValue<short>("clip_size", clip_size);
		reader.ReadParamValue<short>("max_clips", max_clips);
		hit_type = reader.ReadParamValue("hit_type", hit_type.c_str());
		ammo_type = reader.ReadParamValue("ammo_type", ammo_type.c_str());
		ammo_spawn_type = reader.ReadParamValue("ammo_spawn_type", ammo_spawn_type.c_str());

		reader.ReadParamValue<float>("changeFMFireDelayFraction", changeFMFireDelayFraction);
		reader.ReadParamValue<float>("endReloadFraction", endReloadFraction);
		reader.ReadParamValue<float>("fillAmmoReloadFraction", fillAmmoReloadFraction);
		reader.ReadParamValue<bool>("useLowAmmoWarning", useLowAmmoWarning);
		reader.ReadParamValue<bool>("autoReload", autoReload);
		reader.ReadParamValue<bool>("autoSwitch", autoSwitch);
		reader.ReadParamValue<float>("lowAmmoWarningFraction", lowAmmoWarningFraction);
		reader.ReadParamValue<float>("offset", offset);
		reader.ReadParamValue<float>("stabilization", stabilization);
		reader.ReadParamValue<float>("speed_override", speed_override);
		reader.ReadParamValue<float>("stealthEnergyDrainMultiplier", stealthEnergyDrainMultiplier);

#ifndef _RELEASE
		if (!defaultInit && endReloadFraction < fillAmmoReloadFraction)
		{
			const char* weaponName = "";
			for (XmlNodeRef currentNode = paramsNode;;currentNode=currentNode->getParent())
			{
				if (currentNode->getParent())
					continue;
				weaponName = currentNode->getAttr("name");
				break;
			}
			XmlNodeRef fireModeNode = paramsNode->getParent();
			const char* fireModeName = fireModeNode->getAttr("name");
			gEnv->pLog->LogWarning(
				"endReloadFraction is smaller than fillAmmoReloadFraction on '%s' at '%s'",
				weaponName, fireModeName);
		}
#endif
		endReloadFraction = max(endReloadFraction, fillAmmoReloadFraction);
		
		int bulletChamber = 0;
		if (reader.ReadParamValue<int>("bullet_chamber", bulletChamber))
		{
			bullet_chamber = (uint8)bulletChamber;
		}
		
		reader.ReadParamValue<bool>("hasEmptyReload", hasEmptyReload);
		
		reader.ReadParamValue<int>("damage", damage);
		reader.ReadParamValue<float>("damage_drop_per_meter", damage_drop_per_meter);
		reader.ReadParamValue<float>("damage_drop_min_distance", damage_drop_min_distance);
		reader.ReadParamValue<float>("damage_drop_min_damage", damage_drop_min_damage);
		reader.ReadParamValue<float>("point_blank_amount", point_blank_amount);
		reader.ReadParamValue<float>("point_blank_distance", point_blank_distance);
		reader.ReadParamValue<float>("point_blank_falloff_distance", point_blank_falloff_distance);

		reader.ReadParamValue<bool>("secondary_damage", secondary_damage);
开发者ID:PiratesAhoy,项目名称:HeartsOfOak-Core,代码行数:67,代码来源:FireModeParams.cpp


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