本文整理汇总了C++中StarSystem::FindRegion方法的典型用法代码示例。如果您正苦于以下问题:C++ StarSystem::FindRegion方法的具体用法?C++ StarSystem::FindRegion怎么用?C++ StarSystem::FindRegion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StarSystem
的用法示例。
在下文中一共展示了StarSystem::FindRegion方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: while
StarSystem*
Galaxy::FindSystemByRegion(const char* rgn_name)
{
ListIter<StarSystem> iter = systems;
while (++iter) {
StarSystem* sys = iter.value();
if (sys->FindRegion(rgn_name))
return sys;
}
return 0;
}
示例2: if
CampaignMissionRequest*
CampaignPlanMission::PlanRandomFighterMission()
{
CampaignMissionRequest* request = 0;
int type = fighter_mission_types[fighter_mission_index++];
int ownside = player_group->GetIFF();
CombatGroup* primary = player_group;
CombatGroup* obj = 0;
if (fighter_mission_index > 15)
fighter_mission_index = 0;
if (type == Mission::ESCORT_FREIGHT) {
CombatGroup* freight = campaign->FindGroup(ownside, CombatGroup::FREIGHT);
if (!freight || freight->CalcValue() < 1)
type = Mission::PATROL;
else
obj = freight;
}
else if (type == Mission::ESCORT_SHUTTLE) {
CombatGroup* shuttle = campaign->FindGroup(ownside, CombatGroup::LCA_SQUADRON);
if (!shuttle || shuttle->CalcValue() < 1)
type = Mission::PATROL;
else
obj = shuttle;
}
else if (primary->Type() == CombatGroup::WING) {
if (RandomChance())
primary = primary->FindGroup(CombatGroup::INTERCEPT_SQUADRON);
else
primary = primary->FindGroup(CombatGroup::FIGHTER_SQUADRON);
}
if (type >= Mission::AIR_PATROL && type <= Mission::AIR_INTERCEPT) {
CombatZone* zone = 0;
bool airborne = false;
if (primary)
zone = primary->GetAssignedZone();
if (zone && zone->GetRegions().size() > 1) {
Text air_region = *zone->GetRegions().at(1);
StarSystem* system = campaign->GetSystem(zone->System());
if (system) {
OrbitalRegion* rgn = system->FindRegion(air_region);
if (rgn && rgn->Type() == Orbital::TERRAIN)
airborne = true;
}
}
if (!airborne) {
if (type == Mission::AIR_INTERCEPT)
type = Mission::INTERCEPT;
else if (type == Mission::AIR_SWEEP)
type = Mission::SWEEP;
else
type = Mission::PATROL;
}
}
request = new(__FILE__,__LINE__)
CampaignMissionRequest(campaign, type, start, primary);
if (request)
request->SetObjective(obj);
return request;
}