本文整理汇总了C++中IshipIGC::GetSide方法的典型用法代码示例。如果您正苦于以下问题:C++ IshipIGC::GetSide方法的具体用法?C++ IshipIGC::GetSide怎么用?C++ IshipIGC::GetSide使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IshipIGC
的用法示例。
在下文中一共展示了IshipIGC::GetSide方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IsFriendlyCluster
bool CclusterIGC::IsFriendlyCluster(IsideIGC* pside, ClusterQuality cqlty) //Spunky #288
{
int balanceOfPower = 0;
//carrier or ASS in sector = not friendly - Spunky #290
ShipLinkIGC* pshipl = GetShips()->first();
if (pshipl)
{
do
{
IshipIGC* pship = pshipl->data();
if (pship->GetParentShip() == NULL)
if (pship->GetSide() != pside && pship->SeenBySide(pside) && !IsideIGC::AlliedSides(pside, pship->GetSide()))
{
if (pship->GetHullType()->HasCapability(c_habmIsRipcordTarget | c_habmIsLtRipcordTarget))
return false;
if (pship->GetBaseHullType()->GetScannerRange() > 800 && cqlty & cqNoEye)
return false;
balanceOfPower--;
}
else if (pship->GetSide() == pside || IsideIGC::AlliedSides(pside, pship->GetSide()))
balanceOfPower++;
pshipl = pshipl->next();
} while (pshipl);
}
if (balanceOfPower < 0 && cqlty & cqPositiveBOP)
return false;
//Spunky #333
StationLinkIGC* psl = GetStations()->first();
bool ourBaseInCluster = false;
if (psl)
{
do
{
IstationIGC* ps = psl->data();
if (!ps->GetStationType()->HasCapability(c_sabmPedestal) && ps->SeenBySide(pside))
{
if (pside != ps->GetSide() && !IsideIGC::AlliedSides(pside, ps->GetSide())) // #ALLY FIXED 7/10/09 imago
return false;
else
ourBaseInCluster = true;
}
psl = psl->next();
}
while (psl != NULL);
}
if (cqlty & cqIncludeNeutral || ourBaseInCluster)
return true;
else
return false;
}
示例2: 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 ();
}
示例3: Dock
void CFSPlayer::Dock(IstationIGC * pstation)
{
IshipIGC * pship = GetIGCShip();
CFSCluster* pfsCluster = (CFSCluster*)(pstation->GetCluster()->GetPrivateData());
SetDPGroup(pfsCluster, false);
ShipStatus* pss = GetShipStatus(pship->GetSide()->GetObjectID());
pss->SetStationID(pstation->GetObjectID());
pss->SetSectorID(pstation->GetCluster()->GetObjectID());
// Tell them what station they're at
BEGIN_PFM_CREATE(g.fm, pfmDocked, S, DOCKED)
END_PFM_CREATE
pfmDocked->stationID = pstation->GetObjectID();
g.fm.SendMessages(GetConnection(), FM_GUARANTEED, FM_FLUSH);
//CFSShip::Dock(pstation);
}
示例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)
//.........这里部分代码省略.........