36 lines
1.0 KiB
Python
36 lines
1.0 KiB
Python
import time
|
|
|
|
class _event:
|
|
def __init__(self):
|
|
self.type = self.__class__
|
|
|
|
class AnimStart(_event):
|
|
def __init__(self, objectID, animationID):
|
|
super().__init__()
|
|
self.objectID = objectID
|
|
self.animationID = animationID
|
|
|
|
def __repr__(self):
|
|
return f'<AnimFinish | {self.objectID=} | {self.animationID=}>'
|
|
|
|
class AnimFinish(_event):
|
|
def __init__(self, objectID, animationID):
|
|
super().__init__()
|
|
self.objectID = objectID
|
|
self.animationID = animationID
|
|
|
|
def __repr__(self):
|
|
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=}>' |