Update commander.py

This commit is contained in:
Richard Bronkhorst 2023-06-18 21:56:49 +02:00
parent 21f93f078d
commit 3a85c6c367

View File

@ -216,6 +216,17 @@ class Commander(CommandLine):
else:
r = list(self.store.all('Contract'))
pprint(r)
def do_deliver(self):
if not self.has_ship(): return
site = self.ship.location_str
contract = self.active_contract()
delivery = contract.unfinished_delivery()
if delivery is None:
raise CommandError('no delivery')
resource = delivery['trade_symbol']
self.api.deliver(self.ship, resource, contract)
pprint(contract)
def do_ship(self, arg=''):
if arg != '':