AI_PRO/TractorAction.py
2021-03-29 13:32:51 +02:00

19 lines
681 B
Python

from Main import TractorLoad
def action(field, tractor):
if tractor.header and tractor.hitch == "Crop Trailer":
return "toPlow"
elif tractor.hitch == "Tillage Unit" and TractorLoad.TillageUnitLoad == "Fertilizer" and field.state == "toFertilize":
return "toSeed"
elif tractor.hitch == "Tillage Unit" and TractorLoad.TillageUnitLoad == "Seeds" and field.state == "toSeed":
return "toWater"
elif tractor.hitch == "Tillage Unit" and TractorLoad.TillageUnitLoad == "Water" and field.state == "toWater":
return "toCut"
elif tractor.hitch == "Tillage Unit" and TractorLoad.TillageUnitLoad == "None":
return "toFertilize"