Projekt_AI-Automatyczny_saper/Engine/Point.py
2021-03-30 21:01:54 +02:00

24 lines
535 B
Python

class Point:
def __init__(self, x, y):
self.x = x
self.y = y
def getY(self):
return self.y
def getX(self):
return self.x
def __hash__(self):
"""Overrides the default implementation"""
return hash(tuple(sorted(self.__dict__.items())))
def __eq__(self, other):
if isinstance(other, self.__class__):
return self.__dict__ == other.__dict__
else:
return False
def __ne__(self, other):
return not self.__eq__(other)