Added timeouts
This commit is contained in:
@ -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=}>'
|
||||
Reference in New Issue
Block a user