Projekt_Sztuczna_Inteligencja/mine_models/mine.py

20 lines
434 B
Python
Raw Normal View History

2021-04-14 12:01:20 +02:00
# module for abstract classes
from abc import ABC, abstractmethod
# type hints
from typing import Tuple
2021-04-14 12:01:20 +02:00
# 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