forked from SVIG/python-bootcamp
Added simulation files.
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
from abc import ABC, abstractmethod
|
||||
|
||||
class Simulation(ABC):
|
||||
@abstractmethod
|
||||
def start(self):
|
||||
"Start the simulated object."
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def tick(self) -> bool:
|
||||
"""
|
||||
Simulate one clock tick.
|
||||
Returns:
|
||||
bool: True if the simulation could advance one clock tick, or False if the object is expired.
|
||||
"""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def use(self, *args, **kwargs):
|
||||
"""
|
||||
Use the simulated object.
|
||||
Args:
|
||||
args (tuple): A tuple of arguments.
|
||||
kwargs (dict): A dictionary of key-value pairs of arguments.
|
||||
"""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def stop(self):
|
||||
"Stop the simulated object."
|
||||
pass
|
||||
Reference in New Issue
Block a user