hrochland
Prince
This is Zebra9 code modified by The Navy Seal. Part one separately is functional. Parts one and two in couple are not functional.
Can somebody find why, please
Thanks, HROCHland
Can somebody find why, please
Thanks, HROCHland
Code:
def cannotConstruct(self,argsList):
pCity = argsList[0]
eBuilding = argsList[1]
bContinue = argsList[2]
bTestVisible = argsList[3]
bIgnoreCost = argsList[4]
# part one
bCannotConstruct = True
if eBuilding == gc.getInfoTypeForString("BUILDING_A") :
iX = pCity.getX()
iY = pCity.getY()
for iiX in range(iX-1, iX+2, 1):
for iiY in range(iY-1, iY+2, 1):
pPlot = CyMap().plot(iiX,iiY)
if pPlot.getOwner() == pCity.getOwner():
if pPlot.getImprovementType() == gc.getInfoTypeForString("IMPROVEMENT_B"):
bCannotConstruct = False
if bCannotConstruct:
return True
# part two
bCannotConstruct = True
if eBuilding == gc.getInfoTypeForString("BUILDING_C") :
iX = pCity.getX()
iY = pCity.getY()
for iiX in range(iX-1, iX+2, 1):
for iiY in range(iY-1, iY+2, 1):
pPlot = CyMap().plot(iiX,iiY)
if pPlot.getOwner() == pCity.getOwner():
if pPlot.getImprovementType() == gc.getInfoTypeForString("IMPROVEMENT_D"):
bCannotConstruct = False
if bCannotConstruct:
return True
return False