2023-06-13 20:29:04 +00:00
|
|
|
from .system_member import SystemMember
|
2023-06-11 18:51:03 +00:00
|
|
|
from nullptr.util import *
|
|
|
|
from typing import List
|
|
|
|
|
2023-06-13 20:29:04 +00:00
|
|
|
class Waypoint(SystemMember):
|
2023-06-11 18:51:03 +00:00
|
|
|
x:int = 0
|
|
|
|
y:int = 0
|
|
|
|
type:str = 'unknown'
|
|
|
|
traits:List[str]=[]
|
|
|
|
faction:str = ''
|
|
|
|
|
|
|
|
def update(self, d):
|
|
|
|
self.seta('x', d)
|
|
|
|
self.seta('y', d)
|
|
|
|
self.seta('type', d)
|
|
|
|
self.seta('faction', d, 'faction.symbol')
|
2023-06-12 08:51:01 +00:00
|
|
|
self.setlst('traits', d, 'traits', 'symbol')
|
2023-06-11 18:51:03 +00:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def ext(self):
|
|
|
|
return 'way'
|
|
|
|
|
|
|
|
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()}'
|