0ptr/nullptr/models/waypoint.py
2023-06-17 14:59:52 +02:00

26 lines
606 B
Python

from .system_member import SystemMember
from nullptr.util import *
from dataclasses import field
class Waypoint(SystemMember):
x:int = 0
y:int = 0
type:str = 'unknown'
traits:list = []
faction:str = ''
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')
@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()}'