from .base import Base, Reference from nullptr.models.system import System from nullptr.util import * class Waypoint(Base): def define(self): self.x:int = 0 self.y:int = 0 self.type:str = 'unknown' self.traits:list = [] self.faction:str = '' self.system = None def update(self, d): self.seta('x', d) self.seta('y', d) self.seta('type', d) self.seta('faction', d, 'faction.symbol') self.setlst('traits', d, 'traits', 'symbol') self.seta('system', d, self.store.getter(System)) @classmethod def ext(self): return 'way' def path(self): sector, system, _ = self.symbol.split('-') return f'atlas/{sector}/{system[0:1]}/{system}/{self.symbol}.{self.ext()}'