2023-06-22 17:57:07 +00:00
|
|
|
from nullptr.missions.base import BaseMission, MissionParam
|
|
|
|
from nullptr.models.waypoint import Waypoint
|
|
|
|
from nullptr.models.survey import Survey
|
|
|
|
from nullptr.models.contract import Contract
|
|
|
|
class HaulMission(BaseMission):
|
|
|
|
def start_state(self):
|
|
|
|
return 'travel-to'
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def params(cls):
|
|
|
|
return {
|
|
|
|
'site': MissionParam(Waypoint, True),
|
|
|
|
'resource': MissionParam(str, True),
|
|
|
|
'dest': MissionParam(Waypoint, True),
|
|
|
|
'delivery': MissionParam(str, True, 'deliver'),
|
|
|
|
'contract': MissionParam(Contract, False)
|
|
|
|
}
|
|
|
|
|
|
|
|
def steps(self):
|
|
|
|
return {
|
2024-01-06 06:17:53 +00:00
|
|
|
**self.travel_steps('to', 'site', 'dock'),
|
|
|
|
'dock': (self.step_dock, 'market-pre'),
|
|
|
|
'market-pre': (self.step_market, 'load'),
|
|
|
|
'load': (self.step_load, 'market-post'),
|
|
|
|
'market-post': (self.step_market, 'travel-back'),
|
|
|
|
**self.travel_steps('back', 'dest', 'dock-dest'),
|
|
|
|
'dock-dest': (self.step_dock, 'unload'),
|
2024-01-04 20:34:31 +00:00
|
|
|
'unload': (self.step_unload, 'market-dest'),
|
|
|
|
'market-dest': (self.step_market, 'done'),
|
2023-06-22 17:57:07 +00:00
|
|
|
}
|