forked from UNN/2026-rff_mp
19 lines
523 B
Python
19 lines
523 B
Python
class Cell:
|
|
def __init__(self, x, y, is_wall=False, is_start=False, is_exit=False):
|
|
self.x = x
|
|
self.y = y
|
|
self.is_wall = is_wall
|
|
self.is_start = is_start
|
|
self.is_exit = is_exit
|
|
|
|
def __repr__(self):
|
|
return f"Cell({self.x},{self.y})"
|
|
|
|
def __hash__(self):
|
|
return hash((self.x, self.y))
|
|
|
|
def __eq__(self, other):
|
|
return isinstance(other, Cell) and self.x == other.x and self.y == other.y
|
|
|
|
def is_passable(self):
|
|
return not self.is_wall |