2023-06-07 19:48:28 +00:00
|
|
|
|
2023-06-09 11:19:47 +00:00
|
|
|
from .base import Base
|
2023-06-13 14:33:22 +00:00
|
|
|
from math import sqrt
|
2023-06-07 19:48:28 +00:00
|
|
|
|
|
|
|
class System(Base):
|
2023-06-18 17:15:51 +00:00
|
|
|
def define(self):
|
|
|
|
self.x:int = 0
|
|
|
|
self.y:int = 0
|
|
|
|
self.type:str = 'unknown'
|
2023-06-10 18:49:50 +00:00
|
|
|
|
|
|
|
def update(self, d):
|
|
|
|
self.seta('x', d)
|
|
|
|
self.seta('y', d)
|
|
|
|
self.seta('type', d)
|
|
|
|
|
2023-06-10 17:39:32 +00:00
|
|
|
@classmethod
|
2023-06-09 11:19:47 +00:00
|
|
|
def ext(self):
|
|
|
|
return 'stm'
|
2023-06-09 20:20:46 +00:00
|
|
|
|
|
|
|
def path(self):
|
|
|
|
sector, symbol = self.symbol.split('-')
|
2023-06-12 20:36:58 +00:00
|
|
|
return f'atlas/{sector}/{symbol[0:1]}/{self.symbol}.{self.ext()}'
|
2023-06-13 14:33:22 +00:00
|
|
|
|
|
|
|
def distance(self, other):
|
2023-06-14 13:37:48 +00:00
|
|
|
return int(sqrt((self.x - other.x) ** 2 + (self.y - other.y) ** 2))
|
2023-06-17 18:23:24 +00:00
|
|
|
|
|
|
|
def sector(self):
|
|
|
|
return self.symbol.split('-')[0]
|