當前位置: 首頁>>代碼示例>>Python>>正文


Python FleetUtilsAI.get_fleet_system方法代碼示例

本文整理匯總了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
開發者ID:cpeosphoros,項目名稱:freeorion,代碼行數:28,代碼來源:fleet_orders.py

示例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
開發者ID:matt474,項目名稱:freeorion,代碼行數:23,代碼來源:fleet_orders.py


注:本文中的FleetUtilsAI.get_fleet_system方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。