本文整理匯總了Python中FleetUtilsAI.getShipIDWithRole方法的典型用法代碼示例。如果您正苦於以下問題:Python FleetUtilsAI.getShipIDWithRole方法的具體用法?Python FleetUtilsAI.getShipIDWithRole怎麽用?Python FleetUtilsAI.getShipIDWithRole使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FleetUtilsAI
的用法示例。
在下文中一共展示了FleetUtilsAI.getShipIDWithRole方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: issueOrder
# 需要導入模塊: import FleetUtilsAI [as 別名]
# 或者: from FleetUtilsAI import getShipIDWithRole [as 別名]
def issueOrder(self):
if not self.canIssueOrder():
print "can't issue " + self
else:
self.__setExecuted()
# outpost
if AIFleetOrderType.ORDER_OUTPOST == self.getAIFleetOrderType():
shipID = None
if AITargetType.TARGET_SHIP == self.getSourceAITarget().getAITargetType():
shipID = self.getSourceAITarget().getTargetID()
elif AITargetType.TARGET_FLEET == self.getSourceAITarget().getAITargetType():
fleetID = self.getSourceAITarget().getTargetID()
shipID = FleetUtilsAI.getShipIDWithRole(fleetID, AIShipRoleType.SHIP_ROLE_CIVILIAN_OUTPOST)
fo.issueColonizeOrder(shipID, self.getTargetAITarget().getTargetID())
# colonise
elif AIFleetOrderType.ORDER_COLONISE == self.getAIFleetOrderType():
shipID = None
if AITargetType.TARGET_SHIP == self.getSourceAITarget().getAITargetType():
shipID = self.getSourceAITarget().getTargetID()
elif AITargetType.TARGET_FLEET == self.getSourceAITarget().getAITargetType():
fleetID = self.getSourceAITarget().getTargetID()
shipID = FleetUtilsAI.getShipIDWithRole(fleetID, AIShipRoleType.SHIP_ROLE_CIVILIAN_COLONISATION)
fo.issueColonizeOrder(shipID, self.getTargetAITarget().getTargetID())
# invade
elif AIFleetOrderType.ORDER_INVADE == self.getAIFleetOrderType():
shipID = None
if AITargetType.TARGET_SHIP == self.getSourceAITarget().getAITargetType():
shipID = self.getSourceAITarget().getTargetID()
elif AITargetType.TARGET_FLEET == self.getSourceAITarget().getAITargetType():
fleetID = self.getSourceAITarget().getTargetID()
shipID = FleetUtilsAI.getShipIDWithRole(fleetID, AIShipRoleType.SHIP_ROLE_MILITARY_INVASION)
fo.issueInvadeOrder(shipID, self.getTargetAITarget().getTargetID())
# move or resupply
elif (AIFleetOrderType.ORDER_MOVE == self.getAIFleetOrderType()) or (AIFleetOrderType.ORDER_RESUPPLY == self.getAIFleetOrderType()):
fleetID = self.getSourceAITarget().getTargetID()
systemID = self.getTargetAITarget().getTargetID()
fo.issueFleetMoveOrder(fleetID, systemID)
# split fleet
elif AIFleetOrderType.ORDER_SPLIT_FLEET == self.getAIFleetOrderType():
fleetID = self.getSourceAITarget().getTargetID()
shipID = self.getTargetAITarget().getTargetID()
fo.issueNewFleetOrder(str(shipID), shipID)
self.__setExecutionCompleted()
elif (AIFleetOrderType.ORDER_ATACK == self.getAIFleetOrderType()):
fleetID = self.getSourceAITarget().getTargetID()
systemID = self.getTargetAITarget().getRequiredSystemAITargets()[0].getTargetID()
fo.issueFleetMoveOrder(fleetID, systemID)
示例2: issueOrder
# 需要導入模塊: import FleetUtilsAI [as 別名]
# 或者: from FleetUtilsAI import getShipIDWithRole [as 別名]
def issueOrder(self, considerMergers=False):
global dumpTurn
if not self.canIssueOrder(considerMergers=False): #appears to be redundant with check in IAFleetMission?
print "\tcan't issue %s"%self
else:
universe=fo.getUniverse()
self.__setExecuted()
# outpost
if AIFleetOrderType.ORDER_OUTPOST == self.getAIFleetOrderType():
planet=universe.getPlanet(self.getTargetAITarget().target_id)
if not planet.unowned:
self.__setExecutionCompleted()
return
shipID = None
if AITargetType.TARGET_SHIP == self.getSourceAITarget().target_type:
shipID = self.getSourceAITarget().target_id
elif AITargetType.TARGET_FLEET == self.getSourceAITarget().target_type:
fleetID = self.getSourceAITarget().target_id
shipID = FleetUtilsAI.getShipIDWithRole(fleetID, AIShipRoleType.SHIP_ROLE_CIVILIAN_OUTPOST)
if shipID is None:
shipID = FleetUtilsAI.getShipIDWithRole(fleetID, AIShipRoleType.SHIP_ROLE_BASE_OUTPOST)
result=fo.issueColonizeOrder(shipID, self.getTargetAITarget().target_id)
if result==0:
self.__executed = False
# colonise
elif AIFleetOrderType.ORDER_COLONISE == self.getAIFleetOrderType():
shipID = None
if AITargetType.TARGET_SHIP == self.getSourceAITarget().target_type:
shipID = self.getSourceAITarget().target_id
elif AITargetType.TARGET_FLEET == self.getSourceAITarget().target_type:
fleetID = self.getSourceAITarget().target_id
shipID = FleetUtilsAI.getShipIDWithRole(fleetID, AIShipRoleType.SHIP_ROLE_CIVILIAN_COLONISATION)
if shipID is None:
shipID = FleetUtilsAI.getShipIDWithRole(fleetID, AIShipRoleType.SHIP_ROLE_BASE_COLONISATION)
planetID = self.getTargetAITarget().target_id
planet=universe.getPlanet(planetID)
planetName = (planet and planet.name) or "apparently invisible"
result = fo.issueColonizeOrder(shipID, planetID)
print "Ordered colony ship ID %d to colonize %s, got result %d"%(shipID, planetName, result)
if result==0:
self.__executed = False
# invade
elif AIFleetOrderType.ORDER_INVADE == self.getAIFleetOrderType():
result = False
shipID = None
planetID = self.getTargetAITarget().target_id
planet=universe.getPlanet(planetID)
planetName = (planet and planet.name) or "invisible"
if AITargetType.TARGET_SHIP == self.getSourceAITarget().target_type:
shipID = self.getSourceAITarget().target_id
elif AITargetType.TARGET_FLEET == self.getSourceAITarget().target_type:
fleetID = self.getSourceAITarget().target_id
fleet = fo.getUniverse().getFleet(fleetID)
for shipID in fleet.shipIDs:
ship = universe.getShip(shipID)
if (foAI.foAIstate.getShipRole(ship.design.id) in [AIShipRoleType.SHIP_ROLE_MILITARY_INVASION, AIShipRoleType.SHIP_ROLE_BASE_INVASION]):
result = fo.issueInvadeOrder(shipID, planetID) or result #will track if at least one invasion troops successfully deployed
detailStr = ""
if result == 0:
pstealth = planet.currentMeterValue(fo.meterType.stealth)
pop = planet.currentMeterValue(fo.meterType.population)
shields = planet.currentMeterValue(fo.meterType.shield)
owner = planet.owner
detailStr= " -- planet has %.1f stealth, shields %.1f, %.1f population and is owned by empire %d"%(pstealth, shields, pop, owner)
print "Ordered troop ship ID %d to invade %s, got result %d"%(shipID, planetName, result), detailStr
if result == 0:
if 'needsEmergencyExploration' not in dir(foAI.foAIstate):
foAI.foAIstate.needsEmergencyExploration=[]
if fleet.systemID not in foAI.foAIstate.needsEmergencyExploration:
foAI.foAIstate.needsEmergencyExploration.append(fleet.systemID)
print "Due to trouble invading, adding system %d to Emergency Exploration List"%fleet.systemID
self.__executed = False
if shields >0 and owner==-1 and dumpTurn<fo.currentTurn():
dumpTurn=fo.currentTurn()
print "Universe Dump to debug invasions:"
universe.dump()
break
if result:
print "Successfully ordered troop ship(s) to invade %s, with detail%s "%(planetName, detailStr)
# military
elif AIFleetOrderType.ORDER_MILITARY == self.getAIFleetOrderType():
shipID = None
if AITargetType.TARGET_SHIP == self.getSourceAITarget().target_type:
shipID = self.getSourceAITarget().target_id
elif AITargetType.TARGET_FLEET == self.getSourceAITarget().target_type:
fleetID = self.getSourceAITarget().target_id
shipID = FleetUtilsAI.getShipIDWithRole(fleetID, AIShipRoleType.SHIP_ROLE_MILITARY)
#fo.issueFleetMoveOrder(fleetID, self.getTargetAITarget().target_id) #moving is already taken care of separately
targetSysID = self.getTargetAITarget().target_id
fleet = fo.getUniverse().getFleet(fleetID)
systemStatus = foAI.foAIstate.systemStatus.get(targetSysID, {})
if (fleet )and ( fleet.systemID==targetSysID ) and ((systemStatus.get('fleetThreat', 0) + systemStatus.get('planetThreat', 0)+ systemStatus.get('monsterThreat', 0))==0):
self.__setExecutionCompleted()
# move or resupply
elif (AIFleetOrderType.ORDER_MOVE == self.getAIFleetOrderType()) or (AIFleetOrderType.ORDER_RESUPPLY == self.getAIFleetOrderType()):
fleetID = self.getSourceAITarget().target_id
systemID = self.getTargetAITarget().target_id
fleet = fo.getUniverse().getFleet(fleetID)
#.........這裏部分代碼省略.........
示例3: canIssueOrder
# 需要導入模塊: import FleetUtilsAI [as 別名]
# 或者: from FleetUtilsAI import getShipIDWithRole [as 別名]
def canIssueOrder(self, considerMergers=False, verbose=False):
"if FleetOrder can be issued now"
#for some orders, may need to re-issue if invasion/outposting/colonization was interrupted
if self.isExecuted() and self.getAIFleetOrderType() not in [ AIFleetOrderType.ORDER_OUTPOST, AIFleetOrderType.ORDER_COLONISE, AIFleetOrderType.ORDER_INVADE ]:
return False
if not self.isValid():
return False
reason = ""
universe = fo.getUniverse()
fleetID = None
shipID = None
if AITargetType.TARGET_SHIP == self.getSourceAITarget().target_type:
shipID = self.getSourceAITarget().target_id
ship = universe.getShip(shipID)
fleetID = ship.fleetID
elif AITargetType.TARGET_FLEET == self.getSourceAITarget().target_type:
fleetID = self.getSourceAITarget().target_id
fleet = universe.getFleet(fleetID)
systemID = fleet.systemID
sys1=universe.getSystem(systemID)
sysName = (sys1 and sys1.name) or "unknown"
targetID = self.getTargetAITarget().target_id
if verbose:
mainFleetMission=foAI.foAIstate.getAIFleetMission(fleetID)
mainMissionType = (mainFleetMission.getAIMissionTypes() + [-1])[0]
msgP1 = "** %s -- Mission Type %s , current loc sys %d - %s"%( self, AIFleetMissionTypeNames.name(mainMissionType), systemID, sysName )
print msgP1
#
# outpost
#
if AIFleetOrderType.ORDER_OUTPOST == self.getAIFleetOrderType():#TODO: check for separate fleet holding outpost ships
if AITargetType.TARGET_FLEET == self.getSourceAITarget().target_type:
shipID = FleetUtilsAI.getShipIDWithRole(fleetID, AIShipRoleType.SHIP_ROLE_CIVILIAN_OUTPOST)
if shipID is None:
shipID = FleetUtilsAI.getShipIDWithRole(fleetID, AIShipRoleType.SHIP_ROLE_BASE_OUTPOST)
ship = universe.getShip(shipID)
planet = universe.getPlanet(self.getTargetAITarget().target_id)
if (ship != None) and (fleet.systemID == planet.systemID) and ship.canColonize:
return True
return False
#
# colonise
#
elif AIFleetOrderType.ORDER_COLONISE == self.getAIFleetOrderType():#TODO: check for separate fleet holding colony ships
if AITargetType.TARGET_FLEET == self.getSourceAITarget().target_type:
shipID = FleetUtilsAI.getShipIDWithRole(fleetID, AIShipRoleType.SHIP_ROLE_CIVILIAN_COLONISATION)
if shipID is None:
shipID = FleetUtilsAI.getShipIDWithRole(fleetID, AIShipRoleType.SHIP_ROLE_BASE_COLONISATION)
ship = universe.getShip(shipID)
planet = universe.getPlanet(self.getTargetAITarget().target_id)
if ship and not ship.canColonize:
print "Error: colonization fleet %d has no colony ship"%fleetID
if (ship != None) and (fleet.systemID == planet.systemID) and ship.canColonize:
return True
return False
#
# invade
#
elif AIFleetOrderType.ORDER_INVADE == self.getAIFleetOrderType():#TODO: check for separate fleet holding invasion ships
if AITargetType.TARGET_FLEET == self.getSourceAITarget().target_type:
shipID = FleetUtilsAI.getShipIDWithRole(fleetID, AIShipRoleType.SHIP_ROLE_MILITARY_INVASION, False)
if shipID is None:
shipID = FleetUtilsAI.getShipIDWithRole(fleetID, AIShipRoleType.SHIP_ROLE_BASE_INVASION)
ship = universe.getShip(shipID)
planet = universe.getPlanet(self.getTargetAITarget().target_id)
if (ship != None) and (fleet.systemID == planet.systemID) and ship.canInvade and ( planet.currentMeterValue(fo.meterType.shield) ==0):
return True
return False
#
# military
#
elif AIFleetOrderType.ORDER_MILITARY == self.getAIFleetOrderType():
if AITargetType.TARGET_FLEET == self.getSourceAITarget().target_type:
shipID = FleetUtilsAI.getShipIDWithRole(fleetID, AIShipRoleType.SHIP_ROLE_MILITARY)
ship = universe.getShip(shipID)
system = universe.getSystem(self.getTargetAITarget().target_id)
if (ship != None) and (fleet.systemID == system.systemID) and ship.isArmed:
return True
return False
#
# split fleet
#
elif AIFleetOrderType.ORDER_SPLIT_FLEET == self.getAIFleetOrderType():
fleet2 = universe.getFleet(self.getSourceAITarget().target_id)
if len(fleet2.shipIDs) <= 1:
return False
#
# move -- have fleets will do a safety check, also check for potential military fleet mergers
#
elif AIFleetOrderType.ORDER_MOVE == self.getAIFleetOrderType():
#targetID = self.getTargetAITarget().target_id
#TODO: figure out better way to have invasions (& possibly colonizations) require visibility on target without needing visibility of all intermediate systems
if False and mainMissionType not in [ AIFleetMissionType.FLEET_MISSION_ATTACK, #TODO: consider this later
AIFleetMissionType.FLEET_MISSION_MILITARY,
AIFleetMissionType.FLEET_MISSION_SECURE,
#.........這裏部分代碼省略.........
示例4: issueOrder
# 需要導入模塊: import FleetUtilsAI [as 別名]
# 或者: from FleetUtilsAI import getShipIDWithRole [as 別名]
def issueOrder(self, considerMergers=False):
if not self.canIssueOrder(considerMergers=False): #appears to be redundant with check in IAFleetMission?
print "\tcan't issue %s"%self
else:
universe=fo.getUniverse()
self.__setExecuted()
# outpost
if AIFleetOrderType.ORDER_OUTPOST == self.getAIFleetOrderType():
shipID = None
if AITargetType.TARGET_SHIP == self.getSourceAITarget().getAITargetType():
shipID = self.getSourceAITarget().getTargetID()
elif AITargetType.TARGET_FLEET == self.getSourceAITarget().getAITargetType():
fleetID = self.getSourceAITarget().getTargetID()
shipID = FleetUtilsAI.getShipIDWithRole(fleetID, AIShipRoleType.SHIP_ROLE_CIVILIAN_OUTPOST)
fo.issueColonizeOrder(shipID, self.getTargetAITarget().getTargetID())
# colonise
elif AIFleetOrderType.ORDER_COLONISE == self.getAIFleetOrderType():
shipID = None
if AITargetType.TARGET_SHIP == self.getSourceAITarget().getAITargetType():
shipID = self.getSourceAITarget().getTargetID()
elif AITargetType.TARGET_FLEET == self.getSourceAITarget().getAITargetType():
fleetID = self.getSourceAITarget().getTargetID()
shipID = FleetUtilsAI.getShipIDWithRole(fleetID, AIShipRoleType.SHIP_ROLE_CIVILIAN_COLONISATION)
planetID = self.getTargetAITarget().getTargetID()
planet=universe.getPlanet(planetID)
planetName = (planet and planet.name) or "apparently nvisible"
result = fo.issueColonizeOrder(shipID, planetID)
print "Ordered colony ship ID %d to colonize %s, got result %d"%(shipID, planetName, result)
# invade
elif AIFleetOrderType.ORDER_INVADE == self.getAIFleetOrderType():
result = False
shipID = None
planetID = self.getTargetAITarget().getTargetID()
planet=universe.getPlanet(planetID)
planetName = (planet and planet.name) or "invisible"
if AITargetType.TARGET_SHIP == self.getSourceAITarget().getAITargetType():
shipID = self.getSourceAITarget().getTargetID()
elif AITargetType.TARGET_FLEET == self.getSourceAITarget().getAITargetType():
fleetID = self.getSourceAITarget().getTargetID()
fleet = fo.getUniverse().getFleet(fleetID)
for shipID in fleet.shipIDs:
ship = universe.getShip(shipID)
if (foAI.foAIstate.getShipRole(ship.design.id) == AIShipRoleType.SHIP_ROLE_MILITARY_INVASION):
result = fo.issueInvadeOrder(shipID, planetID) or result #will track if at least one invasion troops successfully deployed
print "Ordered troop ship ID %d to invade %s, got result %d"%(shipID, planetName, result)
if result == 0:
if 'needsEmergencyExploration' not in dir(foAI.foAIstate):
foAI.foAIstate.needsEmergencyExploration=[]
foAI.foAIstate.needsEmergencyExploration.append(fleet.systemID)
print "Due to trouble invading, adding system %d to Emergency Exploration List"%fleet.systemID
# military
elif AIFleetOrderType.ORDER_MILITARY == self.getAIFleetOrderType():
shipID = None
if AITargetType.TARGET_SHIP == self.getSourceAITarget().getAITargetType():
shipID = self.getSourceAITarget().getTargetID()
elif AITargetType.TARGET_FLEET == self.getSourceAITarget().getAITargetType():
fleetID = self.getSourceAITarget().getTargetID()
shipID = FleetUtilsAI.getShipIDWithRole(fleetID, AIShipRoleType.SHIP_ROLE_MILITARY)
#fo.issueFleetMoveOrder(fleetID, self.getTargetAITarget().getTargetID()) #moving is already taken care of separately
targetSysID = self.getTargetAITarget().getTargetID()
fleet = fo.getUniverse().getFleet(fleetID)
systemStatus = foAI.foAIstate.systemStatus.get(targetSysID, {})
if (fleet )and ( fleet.systemID==targetSysID ) and ((systemStatus.get('fleetThreat', 0) + systemStatus.get('planetThreat', 0))==0):
self.__setExecutionCompleted()
# move or resupply
elif (AIFleetOrderType.ORDER_MOVE == self.getAIFleetOrderType()) or (AIFleetOrderType.ORDER_RESUPPLY == self.getAIFleetOrderType()):
fleetID = self.getSourceAITarget().getTargetID()
systemID = self.getTargetAITarget().getTargetID()
fleet = fo.getUniverse().getFleet(fleetID)
if systemID not in [fleet.systemID, fleet.nextSystemID] :
fo.issueFleetMoveOrder(fleetID, systemID)
if systemID == fleet.systemID:
if fleetID in ExplorationAI.currentScoutFleetIDs:
if 'needsEmergencyExploration' not in dir(foAI.foAIstate):
foAI.foAIstate.needsEmergencyExploration=[]
if systemID in foAI.foAIstate.needsEmergencyExploration:
del foAI.foAIstate.needsEmergencyExploration[ foAI.foAIstate.needsEmergencyExploration.index(systemID) ]
self.__setExecutionCompleted()
# split fleet
elif AIFleetOrderType.ORDER_SPLIT_FLEET == self.getAIFleetOrderType():
fleetID = self.getSourceAITarget().getTargetID()
shipID = self.getTargetAITarget().getTargetID()
fleet = fo.getUniverse().getFleet(fleetID)
if shipID in fleet.shipIDs:
fo.issueNewFleetOrder(str(shipID), shipID)
self.__setExecutionCompleted()
# attack
elif (AIFleetOrderType.ORDER_ATTACK == self.getAIFleetOrderType()):
fleetID = self.getSourceAITarget().getTargetID()
systemID = self.getTargetAITarget().getRequiredSystemAITargets()[0].getTargetID()
fo.issueFleetMoveOrder(fleetID, systemID)
示例5: canIssueOrder
# 需要導入模塊: import FleetUtilsAI [as 別名]
# 或者: from FleetUtilsAI import getShipIDWithRole [as 別名]
def canIssueOrder(self):
"if FleetOrder can be issued now"
if self.isExecuted():
return False
if not self.isValid():
return False
universe = fo.getUniverse()
# outpost
if AIFleetOrderType.ORDER_OUTPOST == self.getAIFleetOrderType():
fleetID = None
shipID = None
if AITargetType.TARGET_SHIP == self.getSourceAITarget().getAITargetType():
shipID = self.getSourceAITarget().getTargetID()
ship = universe.getShip(shipID)
fleetID = ship.fleetID
elif AITargetType.TARGET_FLEET == self.getSourceAITarget().getAITargetType():
fleetID = self.getSourceAITarget().getTargetID()
shipID = FleetUtilsAI.getShipIDWithRole(fleetID, AIShipRoleType.SHIP_ROLE_CIVILIAN_OUTPOST)
ship = universe.getShip(shipID)
fleet = universe.getFleet(fleetID)
planet = universe.getPlanet(self.getTargetAITarget().getTargetID())
if (ship != None) and (fleet.systemID == planet.systemID) and ship.canColonize:
return True
return False
# colonise
elif AIFleetOrderType.ORDER_COLONISE == self.getAIFleetOrderType():
fleetID = None
shipID = None
if AITargetType.TARGET_SHIP == self.getSourceAITarget().getAITargetType():
shipID = self.getSourceAITarget().getTargetID()
ship = universe.getShip(shipID)
fleetID = ship.fleetID
elif AITargetType.TARGET_FLEET == self.getSourceAITarget().getAITargetType():
fleetID = self.getSourceAITarget().getTargetID()
shipID = FleetUtilsAI.getShipIDWithRole(fleetID, AIShipRoleType.SHIP_ROLE_CIVILIAN_COLONISATION)
ship = universe.getShip(shipID)
fleet = universe.getFleet(fleetID)
planet = universe.getPlanet(self.getTargetAITarget().getTargetID())
if (ship != None) and (fleet.systemID == planet.systemID) and ship.canColonize:
return True
return False
# invade
elif AIFleetOrderType.ORDER_INVADE == self.getAIFleetOrderType():
fleetID = None
shipID = None
if AITargetType.TARGET_SHIP == self.getSourceAITarget().getAITargetType():
shipID = self.getSourceAITarget().getTargetID()
ship = universe.getShip(shipID)
fleetID = ship.fleetID
elif AITargetType.TARGET_FLEET == self.getSourceAITarget().getAITargetType():
fleetID = self.getSourceAITarget().getTargetID()
shipID = FleetUtilsAI.getShipIDWithRole(fleetID, AIShipRoleType.SHIP_ROLE_MILITARY_INVASION)
ship = universe.getShip(shipID)
fleet = universe.getFleet(fleetID)
planet = universe.getPlanet(self.getTargetAITarget().getTargetID())
if (ship != None) and (fleet.systemID == planet.systemID) and ship.canInvade:
return True
return False
# military
elif AIFleetOrderType.ORDER_MILITARY == self.getAIFleetOrderType():
fleetID = None
shipID = None
if AITargetType.TARGET_SHIP == self.getSourceAITarget().getAITargetType():
shipID = self.getSourceAITarget().getTargetID()
ship = universe.getShip(shipID)
fleetID = ship.fleetID
elif AITargetType.TARGET_FLEET == self.getSourceAITarget().getAITargetType():
fleetID = self.getSourceAITarget().getTargetID()
shipID = FleetUtilsAI.getShipIDWithRole(fleetID, AIShipRoleType.SHIP_ROLE_MILITARY)
ship = universe.getShip(shipID)
fleet = universe.getFleet(fleetID)
system = universe.getSystem(self.getTargetAITarget().getTargetID())
if (ship != None) and (fleet.systemID == system.systemID) and ship.isArmed:
return True
return False
# split fleet
elif AIFleetOrderType.ORDER_SPLIT_FLEET == self.getAIFleetOrderType():
fleet = universe.getFleet(self.getSourceAITarget().getTargetID())
if len(fleet.shipIDs) <= 1:
return False
return True