Added timeouts

This commit is contained in:
2025-06-21 23:03:11 +01:00
parent a421069a63
commit 4161ec9c5b
3 changed files with 43 additions and 3 deletions

View File

@ -1,3 +1,5 @@
import time
class _event:
def __init__(self):
self.type = self.__class__
@ -18,4 +20,17 @@ class AnimFinish(_event):
self.animationID = animationID
def __repr__(self):
return f'<AnimFinish | {self.objectID=} | {self.animationID=}>'
return f'<AnimFinish | {self.objectID=} | {self.animationID=}>'
class Timeout(_event):
def __init__(self, timeoutID, fireOn):
super().__init__()
# The timeout ID specified by the user
self.timeoutID = timeoutID
# When the event should be fired
self.fireOn = fireOn
# When it was created
self.created = time.perf_counter()
def __repr__(self):
return f'<Timeout | {self.timeoutID=} | {self.fireOn=} | {self.created=}>'