Projekt_Sztuczna_Inteligencja/mines/mine_models/mine.py
2021-05-22 23:57:48 +02:00

20 lines
434 B
Python

# module for abstract classes
from abc import ABC, abstractmethod
# type hints
from typing import Tuple
# Mine cannot be instantiated
# all abstract methods must be implemented in derived classes
class Mine(ABC):
@abstractmethod
def __init__(self, position: Tuple[int, int], active=True):
self.position = position
self.active = active
@abstractmethod
def disarm(self):
self.active = False