Update analyzer.py, commander.py and three other files

This commit is contained in:
Richard Bronkhorst
2023-06-14 15:37:48 +02:00
parent 939215ef5e
commit fbfa08020b
5 changed files with 50 additions and 27 deletions

View File

@@ -12,7 +12,10 @@ class Base:
self.symbol = symbol
def __hash__(self):
return hash(self.symbol)
return hash((str(type(self)), self.symbol))
def __eq__(self, other):
return self.symbol == other.symbol and type(self) == type(other)
def seta(self, attr, d, name=None):
if name is None:

View File

@@ -21,4 +21,4 @@ class System(Base):
return f'atlas/{sector}/{symbol[0:1]}/{self.symbol}.{self.ext()}'
def distance(self, other):
return sqrt((self.x - other.x) ** 2 + (self.y - other.y) ** 2)
return int(sqrt((self.x - other.x) ** 2 + (self.y - other.y) ** 2))