2021-03-26 15:46:00 +01:00
|
|
|
from .mine import Mine
|
2021-06-06 22:00:42 +02:00
|
|
|
from disarming.parameters.hash_function import TypeHash
|
2021-03-26 15:46:00 +01:00
|
|
|
|
|
|
|
|
|
|
|
class TimeMine(Mine):
|
|
|
|
def __init__(self, position, timer, active=True):
|
|
|
|
self.type = "time"
|
|
|
|
self.timer = timer
|
2021-05-12 14:33:26 +02:00
|
|
|
self.starting_time = timer
|
2021-05-23 20:20:02 +02:00
|
|
|
super().__init__(TypeHash.TIME, position, active)
|
2021-03-26 15:46:00 +01:00
|
|
|
|
2021-05-23 20:20:02 +02:00
|
|
|
def disarm(self, wire):
|
2021-06-17 20:30:32 +02:00
|
|
|
if self.active:
|
2021-06-18 17:55:38 +02:00
|
|
|
self.starting_time = 0
|
2021-06-17 20:30:32 +02:00
|
|
|
return super().disarm(wire)
|
|
|
|
else:
|
|
|
|
# mine has already exploded, no need to return failure
|
|
|
|
return True
|
2021-05-23 20:20:02 +02:00
|
|
|
|
|
|
|
def investigate(self):
|
|
|
|
return super().investigate()
|