0ptr/nullptr/models/jumpgate.py

23 lines
518 B
Python
Raw Normal View History

2023-07-10 17:25:01 +00:00
from .base import Base
from .waypoint import Waypoint
from dataclasses import field
2023-07-10 17:25:01 +00:00
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):
2024-01-02 05:35:26 +00:00
r = super().f(detail)
if detail > 2:
r += '\n'
r += '\n'.join([s.symbol for s in self.connections])
return r