本文整理汇总了C++中FClassMap类的典型用法代码示例。如果您正苦于以下问题:C++ FClassMap类的具体用法?C++ FClassMap怎么用?C++ FClassMap使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FClassMap类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InitClassMap
void InitClassMap(FClassMap &themap, SpawnMap &thedata)
{
themap.Clear();
SpawnMap::Iterator it(thedata);
SpawnMap::Pair *pair;
int error = 0;
while (it.NextPair(pair))
{
PClassActor *cls = NULL;
if (pair->Value.classname != NAME_None)
{
cls = PClass::FindActor(pair->Value.classname);
if (cls == NULL)
{
Printf(TEXTCOLOR_RED "Script error, \"%s\" line %d:\nUnknown actor class %s\n",
pair->Value.filename.GetChars(), pair->Value.linenum, pair->Value.classname.GetChars());
error++;
}
themap.Insert(pair->Key, cls);
}
else
{
themap.Remove(pair->Key);
}
}
if (error > 0)
{
I_Error("%d unknown actor classes found", error);
}
thedata.Clear(); // we do not need this any longer
}
示例2: DumpClassMap
static void DumpClassMap(FClassMap &themap)
{
FClassMap::Iterator it(themap);
FClassMap::Pair *pair, **allpairs;
int i = 0;
// Sort into numerical order, since their arrangement in the map can
// be in an unspecified order.
allpairs = new FClassMap::Pair *[themap.CountUsed()];
while (it.NextPair(pair))
{
allpairs[i++] = pair;
}
qsort(allpairs, i, sizeof(*allpairs), SpawnableSort);
for (int j = 0; j < i; ++j)
{
pair = allpairs[j];
Printf ("%d %s\n", pair->Key, pair->Value->TypeName.GetChars());
}
delete[] allpairs;
}
示例3: FindActor
PClassActor *P_GetSpawnableType(int spawnnum)
{
if (spawnnum < 0)
{ // A named arg from a UDMF map
FName spawnname = FName(ENamedName(-spawnnum));
if (spawnname.IsValidName())
{
return PClass::FindActor(spawnname);
}
}
else
{ // A numbered arg from a Hexen or UDMF map
PClassActor **type = SpawnableThings.CheckKey(spawnnum);
if (type != NULL)
{
return *type;
}
}
return NULL;
}
示例4:
const PClass *GetStrifeType (int typenum)
{
const PClass **ptype = StrifeTypes.CheckKey(typenum);
if (ptype == NULL) return NULL;
else return *ptype;
}
示例5: ClearStrifeTypes
void ClearStrifeTypes()
{
StrifeTypes.Clear();
}
示例6:
PClassActor *GetStrifeType (int typenum)
{
PClassActor **ptype = StrifeTypes.CheckKey(typenum);
if (ptype == NULL) return NULL;
else return *ptype;
}