本文整理汇总了C++中IshipIGC::SetStation方法的典型用法代码示例。如果您正苦于以下问题:C++ IshipIGC::SetStation方法的具体用法?C++ IshipIGC::SetStation怎么用?C++ IshipIGC::SetStation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IshipIGC
的用法示例。
在下文中一共展示了IshipIGC::SetStation方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadUniverse
//------------------------------------------------------------------------------
void Mission4::CreateUniverse (void)
{
LoadUniverse ("training_3", 486, 1030); // an advanced stealth fighter
// stuff for setup
IshipIGC* pShip = trekClient.GetShip();
// set a global attribute to increase the overall energy of the ship
IsideIGC* pSide = pShip->GetSide ();
GlobalAttributeSet gas = pSide->GetGlobalAttributeSet ();
gas.SetAttribute (c_gaMaxEnergy, 10.0f);
pSide->SetGlobalAttributeSet (gas);
// put the commander ship in the station
ImissionIGC* pCore = trekClient.GetCore();
ImodelIGC* pStation = pCore->GetModel (OT_station, 1030);
IshipIGC* pCommander = pCore->GetShip (m_commanderID);
pCommander->SetStation (static_cast<IstationIGC*> (pStation));
pCommander->SetCommand (c_cmdAccepted, NULL, c_cidDoNothing);
pCommander->SetCommand (c_cmdCurrent, NULL, c_cidDoNothing);
pCommander->SetAutopilot (false);
// activate all the starting weapons
trekClient.fGroupFire = true;
// take the missiles off the ship
IpartIGC* pPart = pShip->GetMountedPart (ET_Magazine, 0);
if (pPart)
pPart->Terminate ();
}
示例2: LoadUniverse
//------------------------------------------------------------------------------
void Mission5::CreateUniverse (void)
{
LoadUniverse ("training_5", 412, 1050); // an intercepter
// put the commander ship in the station
ImissionIGC* pCore = trekClient.GetCore();
ImodelIGC* pStation = pCore->GetModel (OT_station, 1050);
IshipIGC* pCommander = pCore->GetShip (m_commanderID);
pCommander->SetStation (static_cast<IstationIGC*> (pStation));
pCommander->SetCommand (c_cmdAccepted, NULL, c_cidDoNothing);
pCommander->SetCommand (c_cmdCurrent, NULL, c_cidDoNothing);
pCommander->SetAutopilot (false);
}
示例3: LoadUniverse
//------------------------------------------------------------------------------
void Mission6::CreateUniverse (void)
{
LoadUniverse ("training_3", 488, 1030); // a fighter 3
// activate all the starting weapons
trekClient.fGroupFire = true;
// put the commander ship in the station
ImissionIGC* pCore = trekClient.GetCore();
ImodelIGC* pStation = pCore->GetModel (OT_station, 1030);
IshipIGC* pCommander = pCore->GetShip (m_commanderID);
pCommander->SetStation (static_cast<IstationIGC*> (pStation));
pCommander->SetCommand (c_cmdAccepted, NULL, c_cidDoNothing);
pCommander->SetCommand (c_cmdCurrent, NULL, c_cidDoNothing);
pCommander->SetAutopilot (false);
}
示例4: GetWindow
//------------------------------------------------------------------------------
void Mission5::SetupShipAndCamera (void)
{
// needed parameters
IshipIGC* pShip = trekClient.GetShip ();
ImissionIGC* pCore = trekClient.GetCore ();
IstationIGC* pStation = pCore->GetStation (1050);
IclusterIGC* pCluster = pCore->GetCluster(GetStartSectorID ());
// set up the ship
trekClient.ResetClusterScanners(pShip->GetSide());
// put the ship in the station
pShip->SetStation (pStation);
// set up the outside view from the station
trekClient.SetViewCluster (pCluster);
// set up the camera
TrekWindow* pWindow = GetWindow ();
pWindow->SetViewMode (TrekWindow::vmCommand);
pWindow->PositionCommandView (NULL, 0.0);
pWindow->SetRadarMode (RadarImage::c_rlAll);
pWindow->EnableDisplacementCommandView (true);
}
示例5: if
void CclusterIGC::Update(Time now)
{
if (now > m_lastUpdate)
{
float dt = now - m_lastUpdate;
bool bStarted = m_pMission->GetMissionStage() == STAGE_STARTED;
if (bStarted)
{
{
//Have any stations launch docked drones
for (StationLinkIGC* l = m_stations.first();
(l != NULL);
l = l->next())
{
IstationIGC* pstation = l->data();
ShipLinkIGC* pslNext;
for (ShipLinkIGC* psl = pstation->GetShips()->first();
(psl != NULL);
psl = pslNext)
{
IshipIGC* pship = psl->data();
pslNext = psl->next(); //Get the next link now since the ship may launch
// const MissionParams* pmp = m_pMission->GetMissionParams(); 04/08 commented out as not needed // mmf 10/07 added so we can get at bExperimental game type
if (pship->GetAutopilot() && (pship->GetPilotType() < c_ptPlayer))
{
//Docked non-players on autopilot never are observers/parents
assert (pship->GetParentShip() == NULL);
assert (pship->GetChildShips()->n() == 0);
// mmf/yp 10/07 added this so drones launch when ordered to even if OkToLaunch might be false
// intentionally left c_cidMine out of the list otherwise miners would launch with their AI
// 'order' to mine
if (pship->OkToLaunch(now) || (pship->GetCommandID(c_cmdAccepted) == c_cidGoto) ||
(pship->GetCommandID(c_cmdAccepted) == c_cidBuild) )
pship->SetStation(NULL);
// if (pship->OkToLaunch(now)) // mmf orig code
// pship->SetStation(NULL);
}
}
//Are any ships buzzing around the stations that a side has yet to eye? #121 #120 Imago 8/10
if (GetShips()->n() > 0 && pstation->GetRoidID() != NA) {
Vector pos = pstation->GetRoidPos();
float Sig = pstation->GetRoidSig();
float Radius = pstation->GetRoidRadius();
if (Sig != 0.0f && Radius != 0.0f) {
//check if they have a ship eying where the rock would be
for (ShipLinkIGC* psl1 = GetShips()->first(); (psl1 != NULL); psl1 = psl1->next()) {
IshipIGC* pship = psl1->data();
if (pship->GetParentShip() || pship->GetSide()->GetObjectID() == pstation->GetSide()->GetObjectID() || pstation->SeenBySide(pship->GetSide()) || !pstation->GetRoidSide(pship->GetSide()->GetObjectID()))
continue;
bool bEye = bSimpleEye(pship->GetHullType()->GetScannerRange(),GetMission()->GetModel(OT_ship,pship->GetObjectID()),Sig,pstation->GetSide()->GetGlobalAttributeSet().GetAttribute(c_gaSignature),Radius,pos);
if (bEye) {
//Turkey 3/13 #353: kill asteroids for all sides in that alliance.
IsideIGC* pside1 = pship->GetSide();
for (SideLinkIGC* sl = m_pMission->GetSides()->first(); sl != NULL; sl = sl->next())
{
IsideIGC* pside2 = sl->data();
if (pside1->AlliedSides(pside1, pside2))
{
pstation->SetRoidSide(pside2->GetObjectID(),false);
GetMission()->GetIgcSite()->KillAsteroidEvent(pstation->GetRoidID(),GetObjectID(),pside2);
}
}
}
}
}
}
}
}
{
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)
//.........这里部分代码省略.........