Projekt_AI-Automatyczny_saper/Engine/Node.py

22 lines
528 B
Python
Raw Normal View History

2021-04-26 21:51:08 +02:00
class Node:
def __init__(self, state):
self.state = state
self.action = None
def getAction(self):
return self.action
def __hash__(self):
"""Overrides the default implementation"""
return hash(self.state)
def __eq__(self, other):
if isinstance(other, self.__class__):
return self.__dict__ == other.__dict__ and self.state.__eq__(other.state)
else:
return False
def __ne__(self, other):
return not self.__eq__(other)