AI_PRO/TractorAction.py

19 lines
681 B
Python
Raw Normal View History

2021-03-29 13:06:57 +02:00
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"