本文整理汇总了C++中IdMap::Insert方法的典型用法代码示例。如果您正苦于以下问题:C++ IdMap::Insert方法的具体用法?C++ IdMap::Insert怎么用?C++ IdMap::Insert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IdMap
的用法示例。
在下文中一共展示了IdMap::Insert方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ParseDoomEdNums
void FMapInfoParser::ParseDoomEdNums()
{
TMap<int, bool> defined;
int error = 0;
MapinfoEdMapItem editem;
editem.filename = sc.ScriptName;
ParseOpenBrace();
while (true)
{
if (sc.CheckString("}")) return;
else if (sc.CheckNumber())
{
int ednum = sc.Number;
sc.MustGetStringName("=");
sc.MustGetString();
bool *def = defined.CheckKey(ednum);
if (def != NULL)
{
sc.ScriptMessage("Editor Number %d defined more than once", ednum);
error++;
}
defined[ednum] = true;
if (sc.String[0] == '$')
{
// add special stuff like playerstarts and sound sequence overrides here, too.
editem.classname = NAME_None;
editem.special = sc.MustMatchString(SpecialMapthingNames) + 1; // todo: assign proper constants
}
else
{
editem.classname = sc.String;
editem.special = -1;
}
memset(editem.args, 0, sizeof(editem.args));
editem.argsdefined = 0;
editem.noskillflags = false;
int minargs = 0;
int maxargs = 5;
FString specialname;
if (sc.CheckString(","))
{
if (sc.CheckString("noskillflags"))
{
editem.noskillflags = true;
if (!sc.CheckString(",")) goto noargs;
}
editem.argsdefined = 5; // mark args as used - if this is done we need to prevent assignment of map args in P_SpawnMapThing.
if (editem.special < 0) editem.special = 0;
if (!sc.CheckNumber())
{
sc.MustGetString();
specialname = sc.String; // save for later error reporting.
editem.special = P_FindLineSpecial(sc.String, &minargs, &maxargs);
if (editem.special == 0 || minargs == -1)
{
sc.ScriptMessage("Invalid special %s for Editor Number %d", sc.String, ednum);
error++;
minargs = 0;
maxargs = 5;
}
if (!sc.CheckString(","))
{
// special case: Special without arguments
if (minargs != 0)
{
sc.ScriptMessage("Incorrect number of args for special %s, min = %d, max = %d, found = 0", specialname.GetChars(), minargs, maxargs);
error++;
}
DoomEdFromMapinfo.Insert(ednum, editem);
continue;
}
sc.MustGetNumber();
}
int i = 0;
while (i < 5)
{
editem.args[i] = sc.Number;
i++;
if (!sc.CheckString(",")) break;
// special check for the ambient sounds which combine the arg being set here with the ones on the mapthing.
if (sc.CheckString("+"))
{
editem.argsdefined = i;
break;
}
sc.MustGetNumber();
}
if (specialname.IsNotEmpty() && (i < minargs || i > maxargs))
{
sc.ScriptMessage("Incorrect number of args for special %s, min = %d, max = %d, found = %d", specialname.GetChars(), minargs, maxargs, i);
error++;
}
}
noargs:
//.........这里部分代码省略.........