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 *
|
2023-06-16 12:41:11 +00:00
|
|
|
from dataclasses import field
|
2023-06-11 18:51:03 +00:00
|
|
|
|
2023-06-13 20:29:04 +00:00
|
|
|
class Waypoint(SystemMember):
|
2023-06-18 17:15:51 +00:00
|
|
|
def define(self):
|
|
|
|
self.x:int = 0
|
|
|
|
self.y:int = 0
|
|
|
|
self.type:str = 'unknown'
|
|
|
|
self.traits:list = []
|
|
|
|
self.faction:str = ''
|
2023-06-11 18:51:03 +00:00
|
|
|
|
|
|
|
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()}'
|