本文整理汇总了C++中IshipIGC::PreplotShipMove方法的典型用法代码示例。如果您正苦于以下问题:C++ IshipIGC::PreplotShipMove方法的具体用法?C++ IshipIGC::PreplotShipMove怎么用?C++ IshipIGC::PreplotShipMove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IshipIGC
的用法示例。
在下文中一共展示了IshipIGC::PreplotShipMove方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
//.........这里部分代码省略.........
}
}
}
{
m_fCost = m_pMission->GetFloatConstant(c_fcidBaseClusterCost);
float costLifepod = m_pMission->GetFloatConstant(c_fcidLifepodCost);
float costTurret = m_pMission->GetFloatConstant(c_fcidTurretCost);
float costPlayer = m_pMission->GetFloatConstant(c_fcidPlayerCost);
float costDrone = m_pMission->GetFloatConstant(c_fcidDroneCost);
//Have miners and builders do any pre-plotted moves. Allow ships to suicide.
ShipLinkIGC* lNext;
for (ShipLinkIGC* l = m_ships.first();
(l != NULL);
l = lNext)
{
IshipIGC* s = l->data();
lNext = l->next();
if (s->GetPilotType() < c_ptPlayer)
m_fCost += costDrone;
else if (s->GetParentShip() != NULL)
m_fCost += costTurret;
else
{
IhullTypeIGC* pht = s->GetBaseHullType();
assert (pht);
m_fCost += pht->HasCapability(c_habmLifepod)
? costLifepod
: costPlayer;
}
s->PreplotShipMove(now);
}
if (m_fCost > 0.0f)
{
m_fCost *= dt / m_pMission->GetFloatConstant(c_fcidClusterDivisor);
}
{
//Have all ships on autopilot plot their moves. Allow ships to suicide.
ShipLinkIGC* lNext;
for (ShipLinkIGC* l = m_ships.first();
(l != NULL);
l = lNext)
{
IshipIGC* s = l->data();
lNext = l->next();
s->PlotShipMove(now);
}
}
}
{
//Have all ships execute their moves
for (ShipLinkIGC* l = m_ships.first();
(l != NULL);
l = l->next())
{
IshipIGC* s = l->data();
if (s->GetParentShip() == NULL)
{