2026-rff_mp/ProninVV/task-2-oop/Observer.py

14 lines
310 B
Python

from abc import ABC, abstractmethod
class Event:
def __init__(self, type: str, data: dict = None):
self.type = type # "maze_loaded", "move", "path_found"
self.data = data if data else {}
class Observer(ABC):
@abstractmethod
def update(self, event: Event) -> None:
pass