Added awaitingTimeout function (not tested, good luck team)
This commit is contained in:
@ -60,4 +60,18 @@ class Game:
|
|||||||
to wait before firing.
|
to wait before firing.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
self._timeouts.append(Timeout(id, time.perf_counter()+delay))
|
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])
|
||||||
Reference in New Issue
Block a user