本文整理汇总了C++中Tool::DetailedName方法的典型用法代码示例。如果您正苦于以下问题:C++ Tool::DetailedName方法的具体用法?C++ Tool::DetailedName怎么用?C++ Tool::DetailedName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tool
的用法示例。
在下文中一共展示了Tool::DetailedName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Collision
void GameManager::Collision(FlyObject* objectA, FlyObject* objectB)
{
int type_ = 0;
if (objectA->Name() == "Player" || objectB->Name() == "Player")
{
if (objectB->Name() == "Player"){
std::swap(objectA, objectB);
}
Player* play = static_cast<Player*>(objectA);
if (objectB->Name() == "EnemyBomb")
{
Weapon *bomb = static_cast<Weapon*>(objectB);
Produce(_T("Explosion"), Point(objectB->X() + objectB->Width() / 2, objectB->Y() + objectB->Height() / 2));
if (!God()){ play->SubHP(bomb->Power());}
if (play->HP() <= 0){
//play->Killed();
OverGame();}
bomb->Killed();
}
if (objectB->Name() == "Enemy")
{
Plane *enemy = static_cast<Plane *>(objectB);
if (enemy->DetailedName() == "Box" || enemy->DetailedName() == "BossLeft" || enemy->DetailedName() == "BossMid" || enemy->DetailedName() == "BossRight") return;
Produce(_T("Explosion"), Point(objectB->X() + objectB->Width() / 2, objectB->Y() + objectB->Height() / 2));
if (!God()) play->SubHP(1);
if (play->HP() <= 0) {
//play->Killed();
OverGame();
}
if (enemy->DetailedName() == "EnemyPrimaryPlane")
{
factory_.ProduceTool(5, *(enemy->Position()), enemy->DetailedName());
}
else if (enemy->DetailedName() == "PropellerPlane")
{
factory_.ProduceTool(6, *(enemy->Position()), enemy->DetailedName());
}
else if (enemy->DetailedName() == "Tank")
{
factory_.ProduceTool(7, *(enemy->Position()), enemy->DetailedName());
}
else if (enemy->DetailedName() == "Box")
{
factory_.ProduceTool(Rand(5, 7), *(enemy->Position()), enemy->DetailedName());
}
enemy->Killed();
}
if (objectB->Name() == "Tool")
{
Tool *tool = static_cast<Tool *>(objectB);
play->AddTool(tool->DetailedName(),tool->EnemyName(),tool->AddMark());
tool->DestroyTool();
}
}
else if (objectA->Name() == "PlayerBomb" || objectB->Name() == "PlayerBomb")
{
if (objectB->Name() == "PlayerBomb")
{
std::swap(objectA,objectB);
}
Weapon* bomb = static_cast<Weapon*>(objectA);
if (objectB->Name() == "Enemy")
{
Plane* enemy = static_cast<Plane*>(objectB);
bomb->Killed();
enemy->SubHP(bomb->Power());
if (enemy->HP() <= 0)
{
Produce(_T("Explosion"),Point(objectB->X() + objectB->Width()/2, objectB->Y() + objectB->Height() / 2));
if (enemy->DetailedName() == "EnemyPrimaryPlane")
{
factory_.ProduceTool(5, *(enemy->Position()),enemy->DetailedName());
}
else if (enemy->DetailedName() == "PropellerPlane")
{
factory_.ProduceTool(6, *(enemy->Position()), enemy->DetailedName());
}
else if (enemy->DetailedName() == "Tank")
{
factory_.ProduceTool(7, *(enemy->Position()), enemy->DetailedName());
}
else if (enemy->DetailedName() == "Box")
{
factory_.ProduceTool(Rand(5,7), *(enemy->Position()), enemy->DetailedName());
}
enemy->Killed();
}
}
}
}