From b023718450577a48cf77d0d90fe20db97836d386 Mon Sep 17 00:00:00 2001 From: Richard Bronkhorst Date: Tue, 20 Jun 2023 22:30:21 +0200 Subject: [PATCH] Update mission.py --- nullptr/mission.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/nullptr/mission.py b/nullptr/mission.py index c4cab2e..a38e497 100644 --- a/nullptr/mission.py +++ b/nullptr/mission.py @@ -349,12 +349,30 @@ class HaulMission(BaseMission): 'orbit2': (self.step_orbit, 'travel') } +class TravelMission(BaseMission): + def start_state(self): + return 'travel' + @classmethod + def params(cls): + return { + 'destination': MissionParam(Waypoint, True) + } + + def steps(self): + return { + 'travel': (self.step_travel_site, { + 'more': 'travel', + 'done': 'done' + }) + } + def create_mission(mtype, ship, store, api): types = { 'survey': SurveyMission, 'mine': MiningMission, - 'haul': HaulMission + 'haul': HaulMission, + 'travel': TravelMission } if mtype not in types: logging.warning(f'invalid mission type {mtype}')