I am restructuring ProductionAI and am rewriting getAvailableBuildLocations:
Code: Select all
def getAvailableBuildLocations(shipDesignID, empireID, ownedPlanetIDs):
"returns locations where shipDesign can be built"
result = []
shipDesign = fo.getShipDesign(shipDesignID)
for planetID in ownedPlanetIDs:
print " getAvailableBuildLocations(" + str(shipDesignID) + ", " + str(empireID) + ", " + str(planetID) + ")"
if shipDesign.productionLocationForEmpire(empireID, planetID):
result.append(planetID)
return result
Code: Select all
2011-02-11 23:07:22,928 DEBUG AI : shipDesignID: 61-Colony Ship
2011-02-11 23:07:22,928 DEBUG AI : getAvailableBuildLocations(61, 6, 150)
2011-02-11 23:07:22,928 ERROR AI : Variable<int>::Eval unable to follow reference: Source.Owner
2011-02-11 23:07:22,928 DEBUG AI : shipDesignID: 63-Mark I
2011-02-11 23:07:22,929 DEBUG AI : getAvailableBuildLocations(63, 6, 150)
2011-02-11 23:07:22,929 ERROR AI : Variable<int>::Eval unable to follow reference: Source.Owner
2011-02-11 23:07:22,929 DEBUG AI : shipDesignID: 69-Scout
2011-02-11 23:07:22,929 DEBUG AI : getAvailableBuildLocations(69, 6, 150)
2011-02-11 23:07:22,929 ERROR AI : Variable<int>::Eval unable to follow reference: Source.Owner