本文整理汇总了C++中nlgeorges::UFormElm::getValueByName方法的典型用法代码示例。如果您正苦于以下问题:C++ UFormElm::getValueByName方法的具体用法?C++ UFormElm::getValueByName怎么用?C++ UFormElm::getValueByName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nlgeorges::UFormElm
的用法示例。
在下文中一共展示了UFormElm::getValueByName方法的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 //
示例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);
}
}
示例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
}
示例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");
}
示例5: 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;
}
示例6: 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");
}
}
示例7: init
void CSampleBankManager::init(NLGEORGES::UFormElm *mixerConfig)
{
if (mixerConfig == 0)
return;
NLGEORGES::UFormElm *virtualBanks;
mixerConfig->getNodeByName(&virtualBanks, ".VirtualBanks");
if (virtualBanks == 0)
return;
uint size;
virtualBanks->getArraySize(size);
for (uint i=0; i<size; ++i)
{
NLGEORGES::UFormElm *virtualBank;
virtualBanks->getArrayNode(&virtualBank, i);
if (virtualBank != 0)
{
std::vector<TFilteredBank> vfb;
std::string virtualName;
virtualBank->getValueByName(virtualName, ".VirtualName");
NLGEORGES::UFormElm *realBanks;
virtualBank->getNodeByName(&realBanks, ".FilteredBank");
if (realBanks != 0)
{
uint size2;
realBanks->getArraySize(size2);
for (uint j=0; j<size2; ++j)
{
TFilteredBank fb;
std::string bankName;
NLGEORGES::UFormElm *realBank;
realBank->getArrayNode(&realBank, j);
realBank->getValueByName(bankName, ".SampleBank");
fb.BankName = CStringMapper::map(bankName);
realBank->getValueByName(fb.Filter, ".Filter");
vfb.push_back(fb);
}
}
if (!vfb.empty())
{
TStringId virtualNameId = CStringMapper::map(virtualName);
m_VirtualBanks.insert(std::make_pair(virtualNameId, vfb));
// create the sample bank
CSampleBank *sampleBank = new CSampleBank(virtualNameId, this);
}
}
}
}
示例8: 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 //
示例9: 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 //
示例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.");
}
示例11:
/**
* 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");
}
示例12: 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());
}
}
}
示例13: 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);
}
}
}
}
示例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 //
示例15: 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");
}