本文整理汇总了C++中common::List::front方法的典型用法代码示例。如果您正苦于以下问题:C++ List::front方法的具体用法?C++ List::front怎么用?C++ List::front使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common::List
的用法示例。
在下文中一共展示了List::front方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: clearList
void clearList(Common::List<T> &list) {
while (!list.empty()) {
T p = list.front();
list.erase(list.begin());
delete p;
}
}
示例2: initGraphicsMode
void GlkEngine::initGraphicsMode() {
uint width = ConfMan.hasKey("width") ? ConfMan.getInt("width") : 640;
uint height = ConfMan.hasKey("height") ? ConfMan.getInt("height") : 480;
Common::List<Graphics::PixelFormat> formats = g_system->getSupportedFormats();
Graphics::PixelFormat format = formats.front();
for (Common::List<Graphics::PixelFormat>::iterator i = formats.begin(); i != formats.end(); ++i) {
if ((*i).bytesPerPixel > 1) {
format = *i;
break;
}
}
initGraphics(width, height, &format);
}
示例3: purgeText
void EMIEngine::purgeText() {
Common::List<TextObject *> toDelete;
foreach (TextObject *t, TextObject::getPool()) {
if (t->getStackLevel() == 0) {
toDelete.push_back(t);
}
}
while (!toDelete.empty()) {
TextObject *t = toDelete.front();
toDelete.pop_front();
delete t;
}
invalidateTextObjectsSortOrder();
}
示例4: fillPathArray
int Actor::fillPathArray(const Point &fromPoint, const Point &toPoint, Point &bestPoint) {
int bestRating;
int currentRating;
Point bestPath;
int pointCounter;
const PathDirectionData *samplePathDirection;
Point nextPoint;
int directionCount;
int16 compressX = (_vm->getGameId() == GID_ITE) ? 2 : 1;
Common::List<PathDirectionData> pathDirectionQueue;
pointCounter = 0;
bestRating = quickDistance(fromPoint, toPoint, compressX);
bestPath = fromPoint;
for (int8 startDirection = 0; startDirection < 4; startDirection++) {
PathDirectionData tmp = { startDirection, fromPoint.x, fromPoint.y };
pathDirectionQueue.push_back(tmp);
}
if (validPathCellPoint(fromPoint)) {
setPathCell(fromPoint, kDirUp);
#ifdef ACTOR_DEBUG
addDebugPoint(fromPoint, 24+36);
#endif
}
while (!pathDirectionQueue.empty()) {
PathDirectionData curPathDirection = pathDirectionQueue.front();
pathDirectionQueue.pop_front();
for (directionCount = 0; directionCount < 3; directionCount++) {
samplePathDirection = &pathDirectionLUT[curPathDirection.direction][directionCount];
nextPoint = Point(curPathDirection.x, curPathDirection.y);
nextPoint.x += samplePathDirection->x;
nextPoint.y += samplePathDirection->y;
if (!validPathCellPoint(nextPoint)) {
continue;
}
if (getPathCell(nextPoint) != kPathCellEmpty) {
continue;
}
setPathCell(nextPoint, samplePathDirection->direction);
#ifdef ACTOR_DEBUG
addDebugPoint(nextPoint, samplePathDirection->direction + 96);
#endif
PathDirectionData tmp = {
samplePathDirection->direction,
nextPoint.x, nextPoint.y };
pathDirectionQueue.push_back(tmp);
++pointCounter;
if (nextPoint == toPoint) {
bestPoint = toPoint;
return pointCounter;
}
currentRating = quickDistance(nextPoint, toPoint, compressX);
if (currentRating < bestRating) {
bestRating = currentRating;
bestPath = nextPoint;
}
}
}
bestPoint = bestPath;
return pointCounter;
}