0ptr/nullptr/models/jumpgate.py
2024-01-13 21:42:49 +01:00

23 lines
518 B
Python

from .base import Base
from .waypoint import Waypoint
from dataclasses import field
class Jumpgate(Base):
def define(self):
self.connections: list = []
def update(self, d):
getter = self.store.getter(Waypoint, create=True)
self.setlst('connections', d, 'connections', interp=getter)
@classmethod
def ext(self):
return 'jmp'
def f(self, detail=1):
r = super().f(detail)
if detail > 2:
r += '\n'
r += '\n'.join([s.symbol for s in self.connections])
return r