29 lines
677 B
Python
29 lines
677 B
Python
from .base import Base
|
|
from dataclasses import field
|
|
|
|
class Jumpgate(Base):
|
|
def define(self):
|
|
self.range: int = 0
|
|
self.faction: str = ''
|
|
self.systems: list = []
|
|
|
|
def update(self, d):
|
|
self.setlst('systems', d, 'connectedSystems', 'symbol')
|
|
self.seta('faction', d, 'factionSymbol')
|
|
self.seta('range', d, 'jumpRange')
|
|
|
|
@classmethod
|
|
def ext(self):
|
|
return 'jmp'
|
|
|
|
def path(self):
|
|
sector, system, _ = self.symbol.split('-')
|
|
return f'atlas/{sector}/{system[0:1]}/{system}/{self.symbol}.{self.ext()}'
|
|
|
|
def f(self, detail=1):
|
|
r = self.symbol
|
|
if detail > 1:
|
|
r += '\n'
|
|
r += '\n'.join(self.systems)
|
|
return r
|