forked from SVIG/python-bootcamp
Added simulation files.
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
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
|
||||
Reference in New Issue
Block a user