• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

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

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: build

// *******************************************************************************************
void CIDToStringArraySheet::build(const NLGEORGES::UFormElm &item)
{
	const UFormElm *stringArray = NULL;
	if (item.getNodeByName(&stringArray, "Array") && stringArray)
	{
		std::string str;
		uint numStr;
		nlverify(stringArray->getArraySize(numStr));
		Array.reserve(numStr);
		for(uint k = 0; k < numStr; ++k)
		{
			const UFormElm *strNode = NULL;
			if (stringArray->getArrayNode(&strNode, k) && strNode)
			{
				Array.push_back(CIDToString());
				Array.back().build(*strNode);
			}
		}
	}
}
开发者ID:CCChaos,项目名称:RyzomCore,代码行数:21,代码来源:id_to_string_array.cpp


示例17:

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

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

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

	// Name
	_Filename = CStringMapper::map(filename);

	// Buffername
	std::string bufferName;
	root.getValueByName(bufferName, ".SoundType.Filename");
	bufferName = CFile::getFilenameWithoutExtension(bufferName);
	_Buffername = CStringMapper::map(bufferName);

	setBuffer(NULL);

	// contain % so it need a context to play
	if (bufferName.find ("%") != string::npos)
	{
		_NeedContext = true;
	}

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

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

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

}
开发者ID:Darkhunter,项目名称:Tranquillien-HCRP-Project-using-NeL,代码行数:44,代码来源:simple_sound.cpp


示例18: importForm

void CStreamSound::importForm(const std::string &filename, NLGEORGES::UFormElm &root)
{
	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");
}
开发者ID:Darkhunter,项目名称:Tranquillien-HCRP-Project-using-NeL,代码行数:23,代码来源:stream_sound.cpp


示例19: importForm

void CBackgroundSound::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 == "background_sound.dfn");

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

	// Read the array of sound with there respective filter.
	{
		_Sounds.clear();

		NLGEORGES::UFormElm *psoundList;

		formRoot.getNodeByName(&psoundList, ".SoundType.Sounds");

		if (psoundList != 0 && psoundList->isArray())
		{
			uint size;
			psoundList->getArraySize(size);

			for (uint i=0; i<size; ++i)
			{
				TSoundInfo	sound;
				NLGEORGES::UFormElm	*psoundItem;

				psoundList->getArrayNode(&psoundItem, i);

				if (psoundItem != NULL)
				{
					// Read the sound name.
					std::string soundName;
					psoundItem->getValueByName(soundName, "Sound");
					sound.SoundName = CStringMapper::map(CFile::getFilenameWithoutExtension(soundName));


					// Read the environnement flag.
					for (uint j=0; j<UAudioMixer::TBackgroundFlags::NB_BACKGROUND_FLAGS; j++)
					{
						char tmp[200];
						sprintf(tmp, "Filter%2.2u", j);
						psoundItem->getValueByName(sound.Filter.Flags[j], tmp);
					}
				}

				_Sounds.push_back(sound);
			}
		}
	}

	_DurationValid = false;
}
开发者ID:mixxit,项目名称:solinia,代码行数:58,代码来源:background_sound.cpp


示例20: build

//-----------------------------------------------
// build :
// Build the sheet from an external script.
//-----------------------------------------------
void CItemSheet::build(const NLGEORGES::UFormElm &item)
{
	// Load the name.
	string Shape;
	if(!item.getValueByName(Shape, "3d.shape"))
		debug("key '3d.shape' not found.");
	IdShape = ClientSheetsStrings.add(Shape);

	// Load the name.
	string ShapeFemale;
	if(!item.getValueByName(ShapeFemale, "3d.shape_female"))
		debug("key '3d.shape_female' not found.");
	IdShapeFemale = ClientSheetsStrings.add(ShapeFemale);

	// Get the icon associated.
	string IconMain;
	if(!item.getValueByName (IconMain, "3d.icon"))
		debug("key '3d.icon' not found.");
	IconMain = strlwr (IconMain);
	IdIconMain = ClientSheetsStrings.add(IconMain);

	// Get the icon associated.
	string IconBack;
	if(!item.getValueByName (IconBack, "3d.icon background"))
		debug("key '3d.icon background' not found.");
	IconBack = strlwr (IconBack);
	IdIconBack = ClientSheetsStrings.add(IconBack);

	// Get the icon associated.
	string IconOver;
	if(!item.getValueByName (IconOver, "3d.icon overlay"))
		debug("key '3d.icon overlay' not found.");
	IconOver = strlwr (IconOver);
	IdIconOver = ClientSheetsStrings.add(IconOver);

	// Get the icon associated.
	string IconOver2;
	if(!item.getValueByName (IconOver2, "3d.icon overlay2"))
		debug("key '3d.icon overlay2' not found.");
	IconOver2 = strlwr (IconOver2);
	IdIconOver2 = ClientSheetsStrings.add(IconOver2);

	// Get Special modulate colors
	item.getValueByName (IconColor, "3d.IconColor" );
	item.getValueByName (IconBackColor, "3d.IconBackColor");
	item.getValueByName (IconOverColor, "3d.IconOverColor");
	item.getValueByName (IconOver2Color, "3d.IconOver2Color");

	// Get the icon text associated.
	string IconText;
	if(!item.getValueByName (IconText, "3d.text overlay"))
		debug("key '3d.text overlay' not found.");
	IconText = strlwr (IconText);
	IdIconText = ClientSheetsStrings.add(IconText);

	// See if this item can be hiden when equiped
	if(!item.getValueByName (NeverHideWhenEquiped, "3d.never hide when equiped"))
		debug("key '3d.never hide when equiped.");

	// Load the different slot in wicth the item can be equipped.
	const UFormElm *pElt = 0;
	// check uint32 is OK!
	nlassert( SLOTTYPE::NB_SLOT_TYPE <= 32 );
	SlotBF= 0;
	if(item.getNodeByName(&pElt, "basics.EquipmentInfo.EquipmentSlots") && pElt)
	{
		// Get all slots.
		uint size;
		if(pElt->getArraySize(size))
		{
			for(uint i = 0; i < size; ++i)
			{
				string slotName;
				if(pElt->getArrayValue(slotName, i))
				{
					// Check name.
					if(slotName.empty())
						debug(toString("The slot name %d is Empty.", i));

					// Push the possible slots for the item in the list.
					SlotBF|= SINT64_CONSTANT(1)<< (SLOTTYPE::stringToSlotType(NLMISC::toUpper(slotName)));
				}
			}
		}
		else
			debug("The element 'basics.Equipment Slot' is not an array.");
	}
	else
		debug("Cannot create the element from the name 'basics.Equipment Slot'.");

	// Get the Item Family.
	string family;
	if(!item.getValueByName(family, "basics.family"))
	{
		debug("Key 'basics.family' not found.");
		Family = ITEMFAMILY::UNDEFINED;
//.........这里部分代码省略.........
开发者ID:AzyxWare,项目名称:ryzom,代码行数:101,代码来源:item_sheet.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ nlmisc::CAABBox类代码示例发布时间:2022-05-31
下一篇:
C++ nite::UserData类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap