23 lines
628 B
Python
23 lines
628 B
Python
# for type hints (predecessor)
|
|
from __future__ import annotations
|
|
|
|
from .mine import Mine
|
|
from objects.mines.disarming.hash_function import TypeHash
|
|
|
|
|
|
class ChainedMine(Mine):
|
|
def __init__(self, position, predecessor: ChainedMine = None, active=True):
|
|
self.type = "chained"
|
|
self.predecessor = predecessor
|
|
super().__init__(TypeHash.CHAINED, position, active)
|
|
|
|
def disarm(self, wire):
|
|
if self.predecessor is None or not self.predecessor.active:
|
|
return super().disarm(wire)
|
|
|
|
else:
|
|
return False
|
|
|
|
def investigate(self):
|
|
return super().investigate()
|