本文整理汇总了C++中Bot::isMarkedForRemoval方法的典型用法代码示例。如果您正苦于以下问题:C++ Bot::isMarkedForRemoval方法的具体用法?C++ Bot::isMarkedForRemoval怎么用?C++ Bot::isMarkedForRemoval使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bot
的用法示例。
在下文中一共展示了Bot::isMarkedForRemoval方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: update
/*
update - This method should be called once per frame. It
goes through all of the sprites, including the player, and calls their
update method such that they may update themselves.
*/
void SpriteManager::update()
{
// UPDATE THE PLAYER SPRITE ANIMATION FRAME/STATE/ROTATION
if (player != nullptr)
player->updateSprite();
// NOW UPDATE THE REST OF THE SPRITES ANIMATION FRAMES/STATES/ROTATIONS
list<Bot*>::iterator botIterator = bots.begin();
list<Bot*> markedBots;
while (botIterator != bots.end())
{
Bot *bot = (*botIterator);
bot->think();
bot->updateSprite();
if (bot->isMarkedForRemoval())
markedBots.push_back(bot);
botIterator++;
}
// NOW REMOVE ALL THE MARKED BOTS FROM THE SPRITE MANAGER
list<Bot*>::iterator markedBotsIterator = markedBots.begin();
while (markedBotsIterator != markedBots.end())
{
Bot *bot = (*markedBotsIterator);
bots.remove(bot);
markedBotsIterator++;
}
// AND UPDATE THE SPAWNING POOLS
vector<BotSpawningPool*>::iterator spawningPoolIterator = spawningPools.begin();
while (spawningPoolIterator != spawningPools.end())
{
BotSpawningPool *pool = (*spawningPoolIterator);
pool->update();
// AND ONTO THE NEXT SPAWNING POOL
spawningPoolIterator++;
}
}