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


Python FleetUtilsAI.assessFleetRole方法代碼示例

本文整理匯總了Python中FleetUtilsAI.assessFleetRole方法的典型用法代碼示例。如果您正苦於以下問題:Python FleetUtilsAI.assessFleetRole方法的具體用法?Python FleetUtilsAI.assessFleetRole怎麽用?Python FleetUtilsAI.assessFleetRole使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在FleetUtilsAI的用法示例。


在下文中一共展示了FleetUtilsAI.assessFleetRole方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: identifyFleetsRoles

# 需要導入模塊: import FleetUtilsAI [as 別名]
# 或者: from FleetUtilsAI import assessFleetRole [as 別名]
def identifyFleetsRoles():
    "identify fleet roles"

    # assign roles to fleets
    universe = fo.getUniverse()
    for fleetID in universe.fleetIDs:
        foAIstate.addFleetRole(fleetID, FleetUtilsAI.assessFleetRole(fleetID))
開發者ID:dbuksbaum,項目名稱:FreeOrion,代碼行數:9,代碼來源:FreeOrionAI.py

示例2: identifyFleetsRoles

# 需要導入模塊: import FleetUtilsAI [as 別名]
# 或者: from FleetUtilsAI import assessFleetRole [as 別名]
def identifyFleetsRoles():
    "identify fleet roles"
    print ("Identifying fleet roles")

    # assign roles to fleets
    universe = fo.getUniverse()
    for fleetID in universe.fleetIDs:
        print ("considering fleet with id: " + str(fleetID))
        foAIstate.addFleetRole(fleetID, FleetUtilsAI.assessFleetRole(fleetID))
開發者ID:adesst,項目名稱:freeorion,代碼行數:11,代碼來源:FreeOrionAI.py

示例3: getFleetRole

# 需要導入模塊: import FleetUtilsAI [as 別名]
# 或者: from FleetUtilsAI import assessFleetRole [as 別名]
    def getFleetRole(self, fleetID,  forceNew=False):
        "returns fleet role by ID"

        if (not forceNew) and fleetID in self.__fleetRoleByID:
            return self.__fleetRoleByID[fleetID]
        else:
            role=FleetUtilsAI.assessFleetRole(fleetID)
            self.__fleetRoleByID[fleetID] = role
            makeAggressive=False
            if role in [AIFleetMissionType.FLEET_MISSION_COLONISATION,  AIFleetMissionType.FLEET_MISSION_OUTPOST]:
                pass
            if role in [AIFleetMissionType.FLEET_MISSION_EXPLORATION]:
                thisRating=self.getRating(fleetID)
                if float(thisRating.get('overall', 0))/thisRating.get('nships', 1) >= 0.5 * ProductionAI.curBestMilShipRating():
                    makeAggressive=True
            else:
                    makeAggressive=True
            fo.issueAggressionOrder(fleetID,  makeAggressive)
            return role
開發者ID:anarsky,項目名稱:freeorion,代碼行數:21,代碼來源:AIstate.py


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