forked from SVIG/python-bootcamp
18 lines
539 B
Python
18 lines
539 B
Python
from Simulation import Simulation
|
|
class HotdogSimulation(Simulation):
|
|
def __init__(self) -> None:
|
|
self.ticks_left = 5
|
|
|
|
def start(self):
|
|
print(f"DEBUG: simulation started.")
|
|
def use(self):
|
|
print(f"DEBUG: someone ate the hot dog! 🌭")
|
|
def tick(self):
|
|
self.ticks_left -= 1
|
|
if self.ticks_left == 0:
|
|
print(f"DEBUG: simulation out of ticks, expiring.")
|
|
return False
|
|
return True
|
|
def stop(self):
|
|
print(f"DEBUG: simulation stopped.")
|
|
pass |