本文整理汇总了C++中IshipIGC::SetFuel方法的典型用法代码示例。如果您正苦于以下问题:C++ IshipIGC::SetFuel方法的具体用法?C++ IshipIGC::SetFuel怎么用?C++ IshipIGC::SetFuel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IshipIGC
的用法示例。
在下文中一共展示了IshipIGC::SetFuel方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
//------------------------------------------------------------------------------
void RepairRearmAction::Execute (void)
{
IshipIGC* pShip = trekClient.GetShip ();
// heal the ship entirely
IshieldIGC* pShield = static_cast<IshieldIGC*> (pShip->GetMountedPart (ET_Shield, 0));
if (pShield)
pShield->SetFraction (1.0f);
pShip->SetFraction (1.0f);
// reload the ammunition, energy, and fuel
pShip->SetEnergy (pShip->GetHullType ()->GetMaxEnergy ());
pShip->SetAmmo (pShip->GetHullType ()->GetMaxAmmo ());
pShip->SetFuel (pShip->GetHullType ()->GetMaxFuel ());
// mdvalley: i needs defining outside the fors
int i;
// fill the first empty cargo slot with missiles
for (i = -1; i > -c_maxCargo; i--)
if (pShip->GetMountedPart (NA, i) == 0)
{
g_pMission->AddPartToShip (150, i, 0x7fff);
break;
}
// fill the second empty cargo slot with ammo
for (; i > -c_maxCargo; i--)
if (pShip->GetMountedPart (NA, i) == 0)
g_pMission->AddPartToShip (24, i, 0x7fff);
// fill all subsequent slots with missiles
for (; i > -c_maxCargo; i--)
if (pShip->GetMountedPart (NA, i) == 0)
g_pMission->AddPartToShip (150, i, 0x7fff);
}