本文整理汇总了C++中FSerializer::GetKey方法的典型用法代码示例。如果您正苦于以下问题:C++ FSerializer::GetKey方法的具体用法?C++ FSerializer::GetKey怎么用?C++ FSerializer::GetKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FSerializer
的用法示例。
在下文中一共展示了FSerializer::GetKey方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReadAllFields
bool PClass::ReadAllFields(FSerializer &ar, void *addr) const
{
bool readsomething = false;
bool foundsomething = false;
const char *key;
key = ar.GetKey();
if (strcmp(key, "classtype"))
{
// this does not represent a DObject
Printf(TEXTCOLOR_RED "trying to read user variables but got a non-object (first key is '%s')", key);
ar.mErrors++;
return false;
}
while ((key = ar.GetKey()))
{
if (strncmp(key, "class:", 6))
{
// We have read all user variable blocks.
break;
}
foundsomething = true;
PClass *type = PClass::FindClass(key + 6);
if (type != nullptr)
{
// Only read it if the type is related to this one.
if (IsDescendantOf(type))
{
if (ar.BeginObject(nullptr))
{
readsomething |= type->VMType->Symbols.ReadFields(ar, addr, type->TypeName.GetChars());
ar.EndObject();
}
}
else
{
DPrintf(DMSG_ERROR, "Unknown superclass %s of class %s\n",
type->TypeName.GetChars(), TypeName.GetChars());
}
}
else
{
DPrintf(DMSG_ERROR, "Unknown superclass %s of class %s\n",
key+6, TypeName.GetChars());
}
}
return readsomething || !foundsomething;
}
示例2: P_ReadACSDefereds
void P_ReadACSDefereds (FSerializer &arc)
{
FString MapName;
P_RemoveDefereds ();
if (arc.BeginObject("deferred"))
{
const char *key;
while ((key = arc.GetKey()))
{
level_info_t *i = FindLevelInfo(key);
if (i == NULL)
{
I_Error("Unknown map '%s' in savegame", key);
}
arc(nullptr, i->deferred);
}
arc.EndObject();
}
}