本文整理汇总了C++中NPC::getPositionCurrent方法的典型用法代码示例。如果您正苦于以下问题:C++ NPC::getPositionCurrent方法的具体用法?C++ NPC::getPositionCurrent怎么用?C++ NPC::getPositionCurrent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NPC
的用法示例。
在下文中一共展示了NPC::getPositionCurrent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadIFOs
bool WorldServer::loadIFOs(Map* curMap, STBFile& warpFile) {
std::string folderPath = std::string(curMap->getMapPath());
if (folderPath.length() == 0)
return true;
#ifdef __ROSE_USE_VFS__
//dword_t fileAmount = this->vfs->getFileCountFromFolder(folderPath.c_str());
std::vector<std::string> files = this->vfs->getFileNamesFromFolder(folderPath.c_str() , ".ifo");
#else
folderPath = workingPath + std::string("\\") + folderPath.substr(0, folderPath.find_last_of("\\") + 1);
//Get all IFOs from the current map directory
QuickInfo::getFilesFromDirectoryA(folderPath, std::string(".ifo"), files);
if (files.size() == 0) {
//In case there are none (for whatever reason), don't do anything
return true;
}
#endif
this->teleGates.reserve(warpFile.getRowCount());
for (unsigned int i = 0; i < this->teleGates.capacity(); i++)
this->teleGates.addValue(Telegate());
/** ASSIGN SECTORS **/
curMap->setSectorWidthAndHeight(this->zoneFile->getZoneSize(curMap->getId()));
//As precaution, as some Maps seem to have 0 as ZoneSize
if (curMap->getSectorWidthAndHeight() == 0) {
curMap->setSectorWidthAndHeight(IFO::CUSTOMIZED_SECTOR_SIZE);
}
curMap->createSectors(files);
//Iterate through all *.ifo files
GlobalLogger::debug("Loading IFOs from path %s...\n", folderPath.c_str());
for (unsigned int j = 0; j < files.size(); j++) {
VFSData fileData; this->vfs->readFile(files.at(j).c_str(), fileData);
IFO ifo(&fileData);
//Add all spawns of the current *.ifo to the map
for (unsigned int k = 0; k < ifo.getSpawnAmount(); k++) {
curMap->addSpawn(new IFOSpawn(ifo.getSpawn(k)));
}
//Add all (IFO-)NPCs to the map
for (unsigned int k = 0; k < ifo.getNPCAmount(); k++) {
IFONPC& npcINFO = ifo.getNPC(k);
NPCData& npcData = this->npcData.at(npcINFO.getObjectId());
NPC *newNpc = new NPC(&npcData, &this->aiData.getValue(npcData.getAIId()), curMap->getId(), npcINFO.getPosition());
newNpc->setDirection(npcINFO.getDirection());
newNpc->setSector(curMap->getSector(newNpc->getPositionCurrent()));
this->globalNPCs.push_back(newNpc);
}
//Create telegates from the previously read IFO-info
this->loadTelegates(curMap->getId(), warpFile, ifo);
}
return true;
}