22 lines
602 B
Python
22 lines
602 B
Python
from .mine import Mine
|
|
from disarming.parameters.hash_function import TypeHash
|
|
|
|
|
|
class TimeMine(Mine):
|
|
def __init__(self, position, timer, active=True):
|
|
self.type = "time"
|
|
self.timer = timer
|
|
self.starting_time = timer
|
|
super().__init__(TypeHash.TIME, position, active)
|
|
|
|
def disarm(self, wire):
|
|
if self.active:
|
|
self.starting_time = 0
|
|
return super().disarm(wire)
|
|
else:
|
|
# mine has already exploded, no need to return failure
|
|
return True
|
|
|
|
def investigate(self):
|
|
return super().investigate()
|