Update analyzer.py, base.py and five other files

This commit is contained in:
Richard Bronkhorst
2023-06-13 22:29:04 +02:00
parent 263fc5d29e
commit f0c7568d38
7 changed files with 48 additions and 19 deletions

View File

@@ -38,7 +38,7 @@ class Base:
def dict(self):
r = {}
for k,v in self.__dict__.items():
if k == 'store':
if k in ['store']:
continue
r[k] = deepcopy(v)
return r

View File

@@ -1,7 +1,7 @@
from .base import Base
from .system_member import SystemMember
from typing import List
class Jumpgate(Base):
class Jumpgate(SystemMember):
range: int
faction: str
systems:List[str] = []

View File

@@ -1,8 +1,8 @@
from .base import Base
from .system_member import SystemMember
from typing import List
class Marketplace(Base):
class Marketplace(SystemMember):
imports:List[str] = []
exports:List[str] = []
exchange:List[str] = []

View File

@@ -0,0 +1,10 @@
from .base import Base
class SystemMember(Base):
@classmethod
def ext(cls):
return 'obj'
def system(self):
p = self.symbol.split('-')
return f'{p[0]}-{p[1]}'

View File

@@ -1,8 +1,8 @@
from .base import Base
from .system_member import SystemMember
from nullptr.util import *
from typing import List
class Waypoint(Base):
class Waypoint(SystemMember):
x:int = 0
y:int = 0
type:str = 'unknown'
@@ -23,7 +23,3 @@ class Waypoint(Base):
def path(self):
sector, system, _ = self.symbol.split('-')
return f'atlas/{sector}/{system[0:1]}/{system}/{self.symbol}.{self.ext()}'
def system(self):
p = self.symbol.split('-')
return f'{p[0]}-{p[1]}'