19 lines
565 B
Python
19 lines
565 B
Python
from abc import ABC, abstractmethod
|
|
from typing import List
|
|
|
|
class PathFindingStrategy(ABC):
|
|
@abstractmethod
|
|
#Находит путь от start до exit_cell
|
|
def find_path(self, maze, start, exit_cell) -> List:
|
|
pass
|
|
|
|
@property
|
|
@abstractmethod
|
|
def name(self) -> str:
|
|
#Имя стратегии
|
|
pass
|
|
|
|
@property
|
|
def visited_count(self) -> int:
|
|
#Количество посещенных клеток (заполняется при поиске)
|
|
return getattr(self, '_visited_count', 0) |