This commit is contained in:
richmans
2023-07-10 21:10:49 +02:00
parent b2f2dc520e
commit ea34bcfab7
4 changed files with 16 additions and 6 deletions

View File

@@ -9,7 +9,7 @@ class Waypoint(Base):
self.type:str = 'unknown'
self.traits:list = []
self.faction:str = ''
self.system = None
self.set_system()
def update(self, d):
self.seta('x', d)
@@ -17,8 +17,12 @@ class Waypoint(Base):
self.seta('type', d)
self.seta('faction', d, 'faction.symbol')
self.setlst('traits', d, 'traits', 'symbol')
self.seta('system', d, self.store.getter(System))
def set_system(self):
parts = self.symbol.split('-')
system_str = f'{parts[0]}-{parts[1]}'
self.system = self.store.get(System, system_str, create=True)
@classmethod
def ext(self):
return 'way'