本文整理汇总了C++中PtrList::empty方法的典型用法代码示例。如果您正苦于以下问题:C++ PtrList::empty方法的具体用法?C++ PtrList::empty怎么用?C++ PtrList::empty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PtrList
的用法示例。
在下文中一共展示了PtrList::empty方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetTile
Tile CMapTile::GetTile(CVector Pos, CMap* pMap)
{
PtrList<CEntity*> EntityList = pMap->GetTileEntityList(Pos);
if(!EntityList.empty()) {
if(ContainsPlayer(EntityList))
return pMap->GetPlayer()->GetTile(pMap);
else if(ContainsMobs(EntityList)) {
PtrList<CEntity*> MobList = FilterMobEntities(EntityList);
return MobList[0]->GetTile(pMap);
} else
return EntityList[0]->GetTile(pMap);
}
else return FloorTile;
}
示例2: OnExamine
void CMapTile::OnExamine(CVector Pos, CMap* pMap, CEntity* pActor)
{
PtrList<CEntity*> EntityList = pMap->GetTileEntityList(Pos);
if(!EntityList.empty()) {
ExamineEntitieList(EntityList);
return;
}
if(this == EmptyTile) {
gMessages.AddMessage("Du schaust in die Weiten des Weltraums WTF!");
return;
}
if(!Flags.Is_Set(MTF_PASSABLE))
gMessages.AddMessage("Du schaust auf ein Stueck feste Wand");
else gMessages.AddMessage("Du kannst dich hier hinbewegen");
}
示例3: writeMsgTxt
static void writeMsgTxt(CStdioFile &file, QID *qid)
{
CString tmp, nick, str;
tmp.LoadString(IDS_MSG_OBJ);
if (qid) {
IcqContact *c = icqLink->findContact(*qid);
if (c)
nick = c->nick.c_str();
else
nick = qid->toString();
str.Format("%s:%s(%s)\n", (LPCTSTR) tmp, qid->toString(), (LPCTSTR) nick);
} else {
str.LoadString(IDS_SYSMSG);
str = tmp + ":" + str + '\n';
}
file.WriteString("--------------------------------------------------\n");
file.WriteString(str);
file.WriteString("--------------------------------------------------\n");
PtrList msgList;
IcqDB::loadMsg(qid, msgList);
while (!msgList.empty()) {
IcqMsg *msg = (IcqMsg *) msgList.front();
msgList.pop_front();
if (!qid)
nick = msg->qid.toString();
exportMsgTxt(file, msg, nick);
delete msg;
}
file.WriteString("\n");
}
示例4: if
//.........这里部分代码省略.........
)
);
Info<< decrIndent;
PtrList<cellSizeFunction> regionCellSizeFunctions;
DynamicList<label> defaultCellSizeRegions;
label nRegionCellSizeFunctions = 0;
// Loop over regions - if any entry is not specified they should
// inherit values from the parent surface.
if (controlFunctionDict.found("regions"))
{
const dictionary& regionsDict = controlFunctionDict.subDict("regions");
const wordList& regionNames = searchableSurface_.regions();
label nRegions = regionsDict.size();
regionCellSizeFunctions.setSize(nRegions);
defaultCellSizeRegions.setCapacity(nRegions);
forAll(regionNames, regionI)
{
const word& regionName = regionNames[regionI];
label regionID = geometryToConformTo_.geometry().findSurfaceRegionID
(
this->name(),
regionName
);
if (regionsDict.found(regionName))
{
// Get the dictionary for region
const dictionary& regionDict = regionsDict.subDict(regionName);
Info<< indent << "Region " << regionName
<< " (ID = " << regionID << ")" << " settings:"
<< endl;
Info<< incrIndent;
regionCellSizeFunctions.set
(
nRegionCellSizeFunctions,
cellSizeFunction::New
(
regionDict,
searchableSurface_,
defaultCellSize_,
labelList(1, regionID)
)
);
Info<< decrIndent;
regionToCellSizeFunctions_[regionID] = nRegionCellSizeFunctions;
nRegionCellSizeFunctions++;
}
else
{
// Add to default list
defaultCellSizeRegions.append(regionID);
}
}
}
if (defaultCellSizeRegions.empty() && !regionCellSizeFunctions.empty())
{
cellSizeFunctions_.transfer(regionCellSizeFunctions);
}
else if (nRegionCellSizeFunctions > 0)
{
regionCellSizeFunctions.setSize(nRegionCellSizeFunctions + 1);
regionCellSizeFunctions.set
(
nRegionCellSizeFunctions,
cellSizeFunction::New
(
controlFunctionDict,
searchableSurface_,
defaultCellSize_,
labelList()
)
);
const wordList& regionNames = searchableSurface_.regions();
forAll(regionNames, regionI)
{
if (regionToCellSizeFunctions_[regionI] == -1)
{
regionToCellSizeFunctions_[regionI] = nRegionCellSizeFunctions;
}
}
cellSizeFunctions_.transfer(regionCellSizeFunctions);
}