本文整理汇总了C++中Holder::GetKeyAsInt方法的典型用法代码示例。如果您正苦于以下问题:C++ Holder::GetKeyAsInt方法的具体用法?C++ Holder::GetKeyAsInt怎么用?C++ Holder::GetKeyAsInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Holder
的用法示例。
在下文中一共展示了Holder::GetKeyAsInt方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InitSpawn
void IniSpawn::InitSpawn(const ieResRef DefaultArea)
{
const char *s;
Holder<DataFileMgr> inifile = GetIniFile(DefaultArea);
if (!inifile) {
strnuprcpy(NamelessSpawnArea, DefaultArea, 8);
return;
}
s = inifile->GetKeyAsString("nameless","destare",DefaultArea);
strnuprcpy(NamelessSpawnArea, s, 8);
s = inifile->GetKeyAsString("nameless","point","[0.0]");
int x,y;
if (sscanf(s,"[%d.%d]", &x, &y)!=2) {
x=0;
y=0;
}
NamelessSpawnPoint.x=x;
NamelessSpawnPoint.y=y;
s = inifile->GetKeyAsString("nameless", "partyarea", DefaultArea);
strnuprcpy(PartySpawnArea, s, 8);
s = inifile->GetKeyAsString("nameless", "partypoint", "[0.0]");
if (sscanf(s,"[%d.%d]", &x, &y) != 2) {
x = NamelessSpawnPoint.x;
y = NamelessSpawnPoint.y;
}
PartySpawnPoint.x = x;
PartySpawnPoint.y = y;
//35 - already standing
//36 - getting up
NamelessState = inifile->GetKeyAsInt("nameless","state",36);
namelessvarcount = inifile->GetKeysCount("namelessvar");
if (namelessvarcount) {
NamelessVar = new VariableSpec[namelessvarcount];
for (y=0;y<namelessvarcount;y++) {
const char* Key = inifile->GetKeyNameByIndex("namelessvar",y);
strnlwrcpy(NamelessVar[y].Name, Key, 32);
NamelessVar[y].Value = inifile->GetKeyAsInt("namelessvar",Key,0);
}
}
localscount = inifile->GetKeysCount("locals");
if (localscount) {
Locals = new VariableSpec[localscount];
for (y=0;y<localscount;y++) {
const char* Key = inifile->GetKeyNameByIndex("locals",y);
strnlwrcpy(Locals[y].Name, Key, 32);
Locals[y].Value = inifile->GetKeyAsInt("locals",Key,0);
}
}
s = inifile->GetKeyAsString("spawn_main","enter",NULL);
if (s) {
ReadSpawnEntry(inifile.get(), s, enterspawn);
}
s = inifile->GetKeyAsString("spawn_main","exit",NULL);
if (s) {
ReadSpawnEntry(inifile.get(), s, exitspawn);
}
s = inifile->GetKeyAsString("spawn_main","events",NULL);
if (s) {
eventcount = CountElements(s,',');
eventspawns = new SpawnEntry[eventcount];
ieVariable *events = new ieVariable[eventcount];
GetElements(s, events, eventcount);
int ec = eventcount;
while(ec--) {
ReadSpawnEntry(inifile.get(), events[ec], eventspawns[ec]);
}
delete[] events;
}
//maybe not correct
InitialSpawn();
}