Projekt_AI-Automatyczny_saper/Engine/PoligonPath.py

22 lines
685 B
Python

from Engine.PathFinder import PathFinder
from Engine.Point import Point
from Engine.Node import Node
from Constants import COLS, ROWS
class PoligonPath(PathFinder):
def __init__(self, board, dTree):
super().__init__(board, dTree)
def checkGoal(self, current):
if current.state.getPoint().__eq__(Point(0,0)):
self.goal = Node(current,None)
return True
return False
def checkField(self, point):
if not (point.getX() < 0 or point.getX() > COLS - 1 or point.getY() < 0 or point.getY() > ROWS - 1) and point not in self.board.stoneMap and point not in self.board.bombMap:
return True
return False