diff --git a/src/gameUtils/base.py b/src/gameUtils/base.py index e873f00..5f57978 100644 --- a/src/gameUtils/base.py +++ b/src/gameUtils/base.py @@ -60,4 +60,18 @@ class Game: to wait before firing. """ - self._timeouts.append(Timeout(id, time.perf_counter()+delay)) \ No newline at end of file + self._timeouts.append(Timeout(id, time.perf_counter()+delay)) + + def awaitingTimeout(self, id: str): + """ + Tells you if a timeout ID is on the timeout stack. + + Args: + id (str): The timeout ID. + + Returns: + bool: True if there is a timeout with that ID + ID on the stack, False otherwise. + """ + + return any([timeout.id == id for timeout in self._timeouts]) \ No newline at end of file