27 lines
518 B
Python
27 lines
518 B
Python
|
|
from .base import Base
|
|
from math import sqrt
|
|
|
|
class System(Base):
|
|
def define(self):
|
|
self.x:int = 0
|
|
self.y:int = 0
|
|
self.type:str = 'unknown'
|
|
self.uncharted = True
|
|
self.last_crawl = 0
|
|
|
|
def update(self, d):
|
|
self.seta('x', d)
|
|
self.seta('y', d)
|
|
self.seta('type', d)
|
|
|
|
@classmethod
|
|
def ext(self):
|
|
return 'stm'
|
|
|
|
def distance(self, other):
|
|
return int(sqrt((self.x - other.x) ** 2 + (self.y - other.y) ** 2))
|
|
|
|
def sector(self):
|
|
return self.symbol.split('-')[0]
|