本文整理汇总了C++中Objects::Destroy方法的典型用法代码示例。如果您正苦于以下问题:C++ Objects::Destroy方法的具体用法?C++ Objects::Destroy怎么用?C++ Objects::Destroy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Objects
的用法示例。
在下文中一共展示了Objects::Destroy方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Update
// TODO: update function
void PhysicsManager::Update()
{
//cout << "Helichopter hit box:" << endl;
//cout << "minX=" << mHelichopter->getHitBoxMinX() << " minY=" << mHelichopter->getHitBoxMinY() <<
// " maxX=" << mHelichopter->getHitBoxMaxX() << " maxY=" << mHelichopter->getHitBoxMaxY() << endl;
vector<MissileObj *>::const_iterator mh_begin = mHeliMissileObjs->begin();
vector<MissileObj *>::const_iterator mh_end = mHeliMissileObjs->end();
vector<MissileObj *>::const_iterator mt_begin = mTurretMissileObjs->begin();
vector<MissileObj *>::const_iterator mt_end = mTurretMissileObjs->end();
vector<ExplosiveObj *>::const_iterator e_begin = mExplosiveObjs->begin();
vector<ExplosiveObj *>::const_iterator e_end = mExplosiveObjs->end();
vector<WallObj *>::const_iterator w_begin = mWallObjs->begin();
vector<WallObj *>::const_iterator w_end = mWallObjs->end();
while(w_begin != w_end)
{
// Check for helichopter against walls
Objects *obj = (Objects*)*w_begin;
if(!mGodMode && HasColided((Objects*)mHelichopter, obj))
{
mHelichopter->Destroy();
}
mh_begin = mHeliMissileObjs->begin();
while(mh_begin != mh_end)
{
// Check each missile against the helichopter
Objects *missileObj = (Objects*)*mh_begin;
// Check each missile against walls
if(HasColided(missileObj, obj))
{
missileObj->Destroy();
}
mh_begin++;
}
mt_begin = mTurretMissileObjs->begin();
while(mt_begin != mt_end)
{
// Check each missile against the helichopter
Objects *missileObj = (Objects*)*mt_begin;
// Check each missile against walls
if(HasColided(missileObj, obj))
{
missileObj->Destroy();
}
mt_begin++;
}
e_begin = mExplosiveObjs->begin();
while(e_begin != e_end)
{
// Check each missile against the helichopter
Objects *ExplosiveObj = (Objects*)*e_begin;
// Check each missile against walls
if(HasColided(ExplosiveObj, obj))
{
ExplosiveObj->Destroy();
}
e_begin++;
}
// Incrememnt the wall pointer
w_begin++;
}
// Turret bullets
mt_begin = mTurretMissileObjs->begin();
while(mt_begin != mt_end)
{
// Check for helichopter against walls
Objects *obj = (Objects*)*mt_begin;
if(!mGodMode && HasColided((Objects*)mHelichopter, obj))
{
mHelichopter->Destroy();
obj->Destroy();
}
// Incrememnt the wall pointer
mt_begin++;
}
// check helicopter against planes
vector<PlaneObj *>::const_iterator p_begin = mPlaneObjs->begin();
vector<PlaneObj *>::const_iterator p_end = mPlaneObjs->end();
p_begin = mPlaneObjs->begin();
while(p_begin != p_end)
{
// Check for helichopter against walls
Objects *obj = (Objects*)*p_begin;
//.........这里部分代码省略.........