本文整理汇总了C++中NameCollection::size方法的典型用法代码示例。如果您正苦于以下问题:C++ NameCollection::size方法的具体用法?C++ NameCollection::size怎么用?C++ NameCollection::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NameCollection
的用法示例。
在下文中一共展示了NameCollection::size方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: reserve
NameCollection::NameCollection(const NameCollection& other)
{
reserve( other.size() );
for( const_iterator it = other.begin();
it != other.end();
++it ) {
push_back( new Name(**it) );
}
}
示例2: convertWorld
//=================================================================
bool TileAssembler::convertWorld()
{
#ifdef _ASSEMBLER_DEBUG
# ifdef _DEBUG
::g_df = fopen("../TileAssembler_debug.txt", "wb");
# else
::g_df = fopen("../TileAssembler_release.txt", "wb");
# endif
#endif
bool result = true;
printf("Reading coordinate mappings...\n");
std::string fname = iSrcDir;
fname.append("/");
fname.append("dir");
iCoordModelMapping->setModelNameFilterMethod(iFilterMethod);
iCoordModelMapping->readCoordinateMapping(fname);
Array<unsigned int> mapIds = iCoordModelMapping->getMaps();
if(mapIds.size() == 0)
{
result = false;
}
for(int i=0; i<mapIds.size() && result; ++i)
{
unsigned int mapId = mapIds[i];
printf("Converting map %lu...\n", mapId);
#ifdef _ASSEMBLER_DEBUG
if(mapId == 0) // "Azeroth" just for debug
{
for(int x=28; x<29 && result; ++x) //debug
{
for(int y=28; y<29 && result; ++y)
{
#else
// ignore DeeprunTram (369) it is too large for short vector and not important
// ignore test (13), Test (29) , development (451)
if(mapId != 369 && mapId != 13 && mapId != 29 && mapId != 451)
{
for(int x=0; x<66 && result; ++x)
{
for(int y=0; y<66 && result; ++y)
{
#endif
printf("Converting cell [%lu][%lu] on map %lu...\n", x, y, mapId);
Array<ModelContainer*> mc;
std::string dirname;
char buffer[100];
if(iCoordModelMapping->isWorldAreaMap(mapId) && x<65 && y<65)
{
sprintf(buffer, "%03u_%d_%d",mapId,x,y); // Let's flip x and y here
dirname = std::string(buffer);
}
else
{
sprintf(buffer, "%03u",mapId);
dirname = std::string(buffer);
}
result = fillModelContainerArray(dirname, mapId, x, y, mc);
emptyArray(mc);
}
}
}
}
#ifdef _ASSEMBLER_DEBUG
if(::g_df) fclose(::g_df);
#endif
return result;
}
//=================================================================
bool TileAssembler::fillModelContainerArray(const std::string& pDirFileName, unsigned int pMapId, int pXPos, int pYPos, Array<ModelContainer*>& pMC)
{
bool result = true;
ModelContainer* modelContainer;
NameCollection nameCollection = iCoordModelMapping->getFilenamesForCoordinate(pMapId, pXPos, pYPos);
if(nameCollection.size() > 0)
{
result = false;
char dirfilename[500];
sprintf(dirfilename,"%s/%s.vmdir",iDestDir.c_str(),pDirFileName.c_str());
FILE *dirfile = fopen(dirfilename, "ab");
if(dirfile)
{
result = true;
char destnamebuffer[500];
char fullnamedestnamebuffer[500];
if(nameCollection.iMainFiles.size() >0)
{
sprintf(destnamebuffer,"%03u_%i_%i.vmap",pMapId, pXPos, pYPos); // flip it here too
std::string checkDoubleStr = std::string(dirfilename);
checkDoubleStr.append("##");
checkDoubleStr.append(std::string(destnamebuffer));
// Check, if same file already is in the same dir file
if(!iCoordModelMapping->isAlreadyProcessedSingleFile(checkDoubleStr))
//.........这里部分代码省略.........