本文整理汇总了C++中idDict::GetNumKeyVals方法的典型用法代码示例。如果您正苦于以下问题:C++ idDict::GetNumKeyVals方法的具体用法?C++ idDict::GetNumKeyVals怎么用?C++ idDict::GetNumKeyVals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类idDict
的用法示例。
在下文中一共展示了idDict::GetNumKeyVals方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: StripReactionPrefix
//
// stripReactionPrefix()
//
void hhReactionHandler::StripReactionPrefix(idDict &dict) {
const idKeyValue *kv = NULL;//dict.MatchPrefix("reaction");
idDict newDict;
for(int i=0;i<dict.GetNumKeyVals();i++) {
kv = dict.GetKeyVal(i);
idStr key;
key = kv->GetKey();
// Do we have a reaction token to strip out?
if(idStr::FindText(key.c_str(), "reaction") != -1) {
int endPrefix = idStr::FindChar(key.c_str(), '_');
if(endPrefix == -1) {
gameLocal.Error("reactionX_ prefix not found.");
}
idStr realKey(key);
realKey = key.Mid(endPrefix+1, key.Length() - endPrefix - 1);
key = realKey;
}
//dict.Delete(kv->GetKey().c_str());
newDict.Set(key.c_str(), kv->GetValue());
kv = dict.MatchPrefix("reaction", kv);
}
dict.Clear();
dict.Copy(newDict);
}
示例2: WriteDict
/*
================
idDemoFile::WriteDict
================
*/
void idDemoFile::WriteDict( const idDict &dict ) {
int i, c;
c = dict.GetNumKeyVals();
WriteInt( c );
for( i = 0; i < c; i++ ) {
WriteHashString( dict.GetKeyVal( i )->GetKey() );
WriteHashString( dict.GetKeyVal( i )->GetValue() );
}
}
示例3: SetCVarsFromDict
/*
============
idCVarSystemLocal::SetCVarsFromDict
============
*/
void idCVarSystemLocal::SetCVarsFromDict( const idDict &dict ) {
idInternalCVar *internal;
for( int i = 0; i < dict.GetNumKeyVals(); i++ ) {
const idKeyValue *kv = dict.GetKeyVal( i );
internal = FindInternal( kv->GetKey() );
if ( internal ) {
internal->InternalServerSetString( kv->GetValue() );
}
}
}