本文整理汇总了C++中idDict::Set方法的典型用法代码示例。如果您正苦于以下问题:C++ idDict::Set方法的具体用法?C++ idDict::Set怎么用?C++ idDict::Set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类idDict
的用法示例。
在下文中一共展示了idDict::Set方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CopyPrefixedSpawnArgs
/*
==============
idSpawner::CopyPrefixedSpawnArgs
==============
*/
void idSpawner::CopyPrefixedSpawnArgs( idEntity *src, const char *prefix, idDict &args ){
const idKeyValue *kv = src->spawnArgs.MatchPrefix( prefix, NULL );
while ( kv ) {
args.Set( kv->GetKey().c_str() + idStr::Length( prefix ), kv->GetValue() );
kv = src->spawnArgs.MatchPrefix( prefix, kv );
}
}
示例2: MoveCVarsToDict
/*
============
idCVarSystemLocal::MoveCVarsToDict
============
*/
const idDict* idCVarSystemLocal::MoveCVarsToDict( int flags ) const {
moveCVarsToDict.Clear();
for( int i = 0; i < cvars.Num(); i++ ) {
idCVar *cvar = cvars[i];
if ( cvar->GetFlags() & flags ) {
moveCVarsToDict.Set( cvar->GetName(), cvar->GetString() );
}
}
return &moveCVarsToDict;
}
示例3: GetAttributes
/*
================
idItem::GetAttributes
================
*/
void idItem::GetAttributes( idDict &attributes ) {
int i;
const idKeyValue *arg;
for( i = 0; i < spawnArgs.GetNumKeyVals(); i++ ) {
arg = spawnArgs.GetKeyVal( i );
if ( arg->GetKey().Left( 4 ) == "inv_" ) {
attributes.Set( arg->GetKey().Right( arg->GetKey().Length() - 4 ), arg->GetValue() );
}
}
}
示例4: ReadDict
/*
================
idDemoFile::ReadDict
================
*/
void idDemoFile::ReadDict( idDict &dict ) {
int i, c;
idStr key, val;
dict.Clear();
ReadInt( c );
for( i = 0; i < c; i++ ) {
key = ReadHashString();
val = ReadHashString();
dict.Set( key, val );
}
}
示例5: Apply
void Setting::Apply(idDict& target)
{
switch (appType)
{
case EAssign:
target.Set(spawnArg, argument);
break;
case EAdd:
// Convert the old setting to float, add the argument, convert back to string and set as value
target.Set(spawnArg, idStr(float(target.GetFloat(spawnArg) + atof(argument))));
break;
case EMultiply:
// Convert the old setting to float, add the argument, convert back to string and set as value
target.Set(spawnArg, idStr(float(target.GetFloat(spawnArg) * atof(argument))));
break;
case EIgnore:
// Ignore => do nothing
break;
default:
break;
};
}
示例6: SaveState
/*
================
idAF::SaveState
================
*/
void idAF::SaveState( idDict &args ) const {
int i;
idAFBody *body;
idStr key, value;
for ( i = 0; i < jointMods.Num(); i++ ) {
body = physicsObj.GetBody( jointMods[i].bodyId );
key = "body " + body->GetName();
value = body->GetWorldOrigin().ToString( 8 );
value += " ";
value += body->GetWorldAxis().ToAngles().ToString( 8 );
args.Set( key, value );
}
}