本文整理汇总了C++中std::vector::Update方法的典型用法代码示例。如果您正苦于以下问题:C++ vector::Update方法的具体用法?C++ vector::Update怎么用?C++ vector::Update使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类std::vector
的用法示例。
在下文中一共展示了vector::Update方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PewShotDraw
void RenderManager::PewShotDraw(std::vector<Pew> &vector, std::vector<Pew>::iterator &iterator, int &points, IngameSound &sound, HighscoreManager &highscore, std::vector<Enemy> &enemyv, std::vector<SpaceMonkey> &monkeyv, std::vector<ShitBullets> &shitv, std::vector<Boss1> &boss1v, std::vector<Boss2> &boss2v, std::vector<Boss2Weapon> &boss2weaponv, std::vector<EnemyFormation> &enemyFormationv, std::vector<Boss3> &boss3v, std::vector<Boss3firstWeapon> &b3FWeapon, std::vector<Boss3SecWeapon> &b3SWeapon, sf::RenderWindow &window, float &elapsedTime)
{
for (iterator = vector.begin(); iterator != vector.end();)
{
if (!iterator->active)
{
iterator = vector.erase(iterator);
}
else
{
coll::ProjectileToList(iterator, enemyv, points, sound, highscore);//enemy
coll::ProjectileToMonkey(iterator, monkeyv, points, sound, highscore);//monkey
coll::ProjectileToListNoHealth(iterator, shitv, points, sound, highscore);//shit
coll::ProjectileToListNoHealth(iterator, boss2weaponv, points, sound, highscore);//boss2Weapon
coll::ProjectileToListNoHealth(iterator, b3FWeapon, points, sound, highscore);//boss3FirstWeapon
coll::ProjectileToList(iterator, b3SWeapon, points, sound, highscore);//boss3SecWeapon
coll::Boss2Collision(iterator, boss2v, points, sound, highscore);//boss2
coll::ProjectileToList(iterator, enemyFormationv, points, sound, highscore);//enemyFormation
coll::Boss3Collision(boss3v, iterator, sound, highscore, points);//boss3
iterator->Update(elapsedTime);
iterator->Render(window);
++iterator;
}
}
}
示例2:
void RenderManager::Boss2WeaponDraw(std::vector<Boss2Weapon> &vector, std::vector<Boss2Weapon>::iterator &iterator, float &elapsedTime, Player &pPlayer, Player2 &player2, sf::RenderWindow &window)
{
for (iterator = vector.begin(); iterator != vector.end();)
{
if (!iterator->active)
{
iterator = vector.erase(iterator);
}
else
{
iterator->Update(window, elapsedTime, pPlayer, player2);
iterator->Render(window);
++iterator;
}
}
}
示例3: DoubleShotDraw
void RenderManager::DoubleShotDraw(std::vector<DoubleShot> &vector, std::vector<DoubleShot>::iterator &iterator, int &points, IngameSound &sound, HighscoreManager &highscore, std::vector<Enemy> &enemyv, std::vector<SpaceMonkey> &monkeyv, std::vector<ShitBullets> &shitv, std::vector<Boss1> &boss1v, bool &boss1Dead, std::vector<Boss2Weapon> &boss2weaponv, std::vector<EnemyFormation> &enemyFormationv, sf::RenderWindow &window, float &elapsedTime)
{
for (iterator = vector.begin(); iterator != vector.end();)
{
if (!iterator->active)
{
iterator = vector.erase(iterator);
}
else
{
coll::ProjectileToList(iterator, enemyv, points, sound, highscore);//enemy
coll::ProjectileToMonkey(iterator, monkeyv, points, sound, highscore);//monkey
coll::ProjectileToListNoHealth(iterator, shitv, points, sound, highscore);//shit
coll::ProjectileToListNoHealth(iterator, boss2weaponv, points, sound, highscore);//boss2Weapon
coll::BossCollision(iterator, boss1v, points, sound, highscore, boss1Dead);//boss1
coll::ProjectileToList(iterator, enemyFormationv, points, sound, highscore);//enemyFormation
iterator->Update(window, elapsedTime);
iterator->Render(window);
++iterator;
}
}
}