20 lines
434 B
Python
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
|