2021-04-14 12:01:20 +02:00
|
|
|
# module for abstract classes
|
2021-03-26 15:46:00 +01:00
|
|
|
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
|
2021-03-26 15:46:00 +01:00
|
|
|
|
|
|
|
|
|
|
|
class Mine(ABC):
|
|
|
|
@abstractmethod
|
|
|
|
def __init__(self, position: Tuple[int, int], active=True):
|
|
|
|
self.position = position
|
|
|
|
self.active = active
|
|
|
|
|
|
|
|
@abstractmethod
|
|
|
|
def disarm(self):
|
2021-05-20 15:01:09 +02:00
|
|
|
self.active = False
|