本文整理匯總了Python中FleetUtilsAI.get_fleet_system方法的典型用法代碼示例。如果您正苦於以下問題:Python FleetUtilsAI.get_fleet_system方法的具體用法?Python FleetUtilsAI.get_fleet_system怎麽用?Python FleetUtilsAI.get_fleet_system使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FleetUtilsAI
的用法示例。
在下文中一共展示了FleetUtilsAI.get_fleet_system方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: issue_order
# 需要導入模塊: import FleetUtilsAI [as 別名]
# 或者: from FleetUtilsAI import get_fleet_system [as 別名]
def issue_order(self):
if not super(OrderResupply, self).issue_order():
return
fleet_id = self.fleet.id
system_id = self.target.get_system().id
fleet = self.fleet.get_object()
if system_id not in [fleet.systemID, fleet.nextSystemID]:
# if self.order_type == AIFleetOrderType.ORDER_MOVE:
# dest_id = system_id
# else:
# if self.order_type == AIFleetOrderType.ORDER_REPAIR:
# fo.issueAggressionOrder(fleet_id, False)
start_id = FleetUtilsAI.get_fleet_system(fleet)
dest_id = MoveUtilsAI.get_safe_path_leg_to_dest(fleet_id, start_id, system_id)
print "fleet %d with order type(%s) sent to safe leg dest %s and ultimate dest %s" % (
fleet_id, self.ORDER_NAME,
PlanetUtilsAI.sys_name_ids([dest_id]),
PlanetUtilsAI.sys_name_ids([system_id]))
fo.issueFleetMoveOrder(fleet_id, dest_id)
print "Order issued: %s fleet: %s target: %s" % (self.ORDER_NAME, self.fleet, self.target)
if system_id == fleet.systemID:
if foAI.foAIstate.get_fleet_role(fleet_id) == MissionType.EXPLORATION:
if system_id in foAI.foAIstate.needsEmergencyExploration:
foAI.foAIstate.needsEmergencyExploration.remove(system_id)
self.order_issued = True
示例2: issue_order
# 需要導入模塊: import FleetUtilsAI [as 別名]
# 或者: from FleetUtilsAI import get_fleet_system [as 別名]
def issue_order(self):
if not super(OrderResupply, self).issue_order():
return False
fleet_id = self.fleet.id
system_id = self.target.get_system().id
fleet = self.fleet.get_object()
if system_id == fleet.systemID:
if foAI.foAIstate.get_fleet_role(fleet_id) == MissionType.EXPLORATION:
if system_id in foAI.foAIstate.needsEmergencyExploration:
foAI.foAIstate.needsEmergencyExploration.remove(system_id)
return True
if system_id != fleet.nextSystemID:
self.executed = False
start_id = FleetUtilsAI.get_fleet_system(fleet)
dest_id = MoveUtilsAI.get_safe_path_leg_to_dest(fleet_id, start_id, system_id)
universe = fo.getUniverse()
print "fleet %d with order type(%s) sent to safe leg dest %s and ultimate dest %s" % (
fleet_id, self.ORDER_NAME, universe.getSystem(dest_id), universe.getSystem(system_id))
fo.issueFleetMoveOrder(fleet_id, dest_id)
print "Order issued: %s fleet: %s target: %s" % (self.ORDER_NAME, self.fleet, self.target)
return True