forked from s452751/AI_PRO
20 lines
777 B
Python
20 lines
777 B
Python
from Main import TractorLoad
|
|
from Main.TractorLoad import TillageUnit
|
|
|
|
|
|
def action(field, tractor, tillageUnit):
|
|
if tractor.header and tractor.hitch == "Crop Trailer" and field.state == "toCut":
|
|
return "toPlow"
|
|
|
|
elif isinstance(tractor.hitch, TillageUnit) and tillageUnit.load == "Fertilizer" and field.state == "toFertilize":
|
|
return "toSeed"
|
|
|
|
elif isinstance(tractor.hitch, TillageUnit) and tillageUnit.load == "Seeds" and field.state == "toSeed":
|
|
return "toWater"
|
|
|
|
elif isinstance(tractor.hitch, TillageUnit) and tillageUnit.load == "Water" and field.state == "toWater":
|
|
return "toCut"
|
|
|
|
elif isinstance(tractor.hitch, TillageUnit) and tillageUnit.load == "Nothing" and field.state == "toPlow":
|
|
return "toFertilize"
|