From: <geo...@us...> - 2012-07-06 08:06:15
|
Revision: 4985 http://freeorion.svn.sourceforge.net/freeorion/revision/?rev=4985&view=rev Author: geoffthemedio Date: 2012-07-06 08:06:04 +0000 (Fri, 06 Jul 2012) Log Message: ----------- Removed or replaced some food and mining enums with a growth enum, and removed some mining-related priority and focus-related code. Modified Paths: -------------- trunk/FreeOrion/default/AI/EnumsAI.py trunk/FreeOrion/default/AI/ResourcesAI.py Modified: trunk/FreeOrion/default/AI/EnumsAI.py =================================================================== --- trunk/FreeOrion/default/AI/EnumsAI.py 2012-07-06 08:04:06 UTC (rev 4984) +++ trunk/FreeOrion/default/AI/EnumsAI.py 2012-07-06 08:06:04 UTC (rev 4985) @@ -19,8 +19,7 @@ class AIPriorityType(object): PRIORITY_INVALID = -1 - PRIORITY_RESOURCE_FOOD = 0 - PRIORITY_RESOURCE_MINERALS = 1 + PRIORITY_RESOURCE_GROWTH = 0 PRIORITY_RESOURCE_PRODUCTION = 2 PRIORITY_RESOURCE_RESEARCH = 3 PRIORITY_RESOURCE_TRADE = 4 @@ -182,8 +181,7 @@ return __getInterval(0, 2) class AIFocusType(object): - FOCUS_FARMING = "FOCUS_FARMING" - FOCUS_MINING = "FOCUS_MINING" + FOCUS_GROWTH = "FOCUS_GROWTH" FOCUS_INDUSTRY = "FOCUS_INDUSTRY" FOCUS_RESEARCH = "FOCUS_RESEARCH" FOCUS_TRADE = "FOCUS_TRADE" Modified: trunk/FreeOrion/default/AI/ResourcesAI.py =================================================================== --- trunk/FreeOrion/default/AI/ResourcesAI.py 2012-07-06 08:04:06 UTC (rev 4984) +++ trunk/FreeOrion/default/AI/ResourcesAI.py 2012-07-06 08:06:04 UTC (rev 4985) @@ -35,20 +35,13 @@ capitalID = empire.capitalID topPriority = topResourcePriority() - if topPriority == AIPriorityType.PRIORITY_RESOURCE_FOOD: - newFocus = AIFocusType.FOCUS_FARMING + if topPriority == AIPriorityType.PRIORITY_RESOURCE_GROWTH: + newFocus = AIFocusType.FOCUS_GROWTH for planetID in ownedPlanetIDs: planet = universe.getPlanet(planetID) focus = newFocus if planetID == capitalID and focus in planet.availableFoci: fo.issueChangeFocusOrder(planetID, focus) - elif topPriority == AIPriorityType.PRIORITY_RESOURCE_MINERALS: - newFocus = AIFocusType.FOCUS_MINING - for planetID in ownedPlanetIDs: - planet = universe.getPlanet(planetID) - focus = newFocus - if planetID == capitalID and focus in planet.availableFoci: - fo.issueChangeFocusOrder(planetID, focus) elif topPriority == AIPriorityType.PRIORITY_RESOURCE_PRODUCTION: newFocus = AIFocusType.FOCUS_INDUSTRY for planetID in ownedPlanetIDs: @@ -79,20 +72,13 @@ fleetSupplyableSystemIDs = empire.fleetSupplyableSystemIDs fleetSupplyablePlanetIDs = PlanetUtilsAI.getPlanetsInSystemsIDs(fleetSupplyableSystemIDs) - if topPriority == AIPriorityType.PRIORITY_RESOURCE_FOOD: - newFocus = AIFocusType.FOCUS_FARMING + if topPriority == AIPriorityType.PRIORITY_RESOURCE_GROWTH: + newFocus = AIFocusType.FOCUS_GROWTH for planetID in generalPlanetIDs: planet = universe.getPlanet(planetID) focus = newFocus if focus in planet.availableFoci: fo.issueChangeFocusOrder(planetID, focus) - elif topPriority == AIPriorityType.PRIORITY_RESOURCE_MINERALS: - newFocus = AIFocusType.FOCUS_MINING - for planetID in generalPlanetIDs: - planet = universe.getPlanet(planetID) - focus = newFocus - if planetID in fleetSupplyablePlanetIDs and focus in planet.availableFoci: - fo.issueChangeFocusOrder(planetID, focus) elif topPriority == AIPriorityType.PRIORITY_RESOURCE_PRODUCTION: newFocus = AIFocusType.FOCUS_INDUSTRY for planetID in generalPlanetIDs: @@ -119,7 +105,7 @@ empire = fo.getEmpire() empireID = empire.empireID ownedPlanetIDs = PlanetUtilsAI.getOwnedPlanetsByEmpire(universe.planetIDs, empireID) - newFocus = AIFocusType.FOCUS_MINING + newFocus = AIFocusType.FOCUS_INDUSTRY for planetID in ownedPlanetIDs: planet = universe.getPlanet(planetID) focus = newFocus |