2023-06-13 20:29:04 +00:00
|
|
|
from .system_member import SystemMember
|
2023-06-16 12:41:11 +00:00
|
|
|
from dataclasses import field
|
2023-06-12 08:51:01 +00:00
|
|
|
|
2023-06-13 20:29:04 +00:00
|
|
|
class Jumpgate(SystemMember):
|
2023-06-12 08:51:01 +00:00
|
|
|
range: int
|
|
|
|
faction: str
|
2023-06-17 12:59:52 +00:00
|
|
|
systems: list = []
|
2023-06-12 08:51:01 +00:00
|
|
|
|
|
|
|
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):
|
2023-06-12 20:36:58 +00:00
|
|
|
sector, system, _ = self.symbol.split('-')
|
|
|
|
return f'atlas/{sector}/{system[0:1]}/{system}/{self.symbol}.{self.ext()}'
|
2023-06-17 12:59:52 +00:00
|
|
|
|
|
|
|
def f(self, detail=1):
|
|
|
|
r = self.symbol
|
|
|
|
if detail > 1:
|
2023-06-17 18:23:24 +00:00
|
|
|
r += '\n'
|
2023-06-17 12:59:52 +00:00
|
|
|
r += '\n'.join(self.systems)
|
|
|
|
return r
|