messages now a bit different, less contructions
not constructing one for each possible message but only constructing when message happens
This commit is contained in:
@@ -38,12 +38,13 @@ class Message:
|
||||
self._args = []
|
||||
|
||||
|
||||
def msg(message, params):
|
||||
if not issubclass(type(message), Message):
|
||||
window.console.log("Not scheduling a Message type, this will not work!")
|
||||
return lambda: None
|
||||
|
||||
def msg(message_class, params):
|
||||
def callback(event):
|
||||
message.on_event(event) #message_class(event, params)
|
||||
message = message_class(params)
|
||||
if not issubclass(type(message), Message):
|
||||
window.console.log("Not scheduling a Message type, this will not work!")
|
||||
return
|
||||
|
||||
message.on_event(event)
|
||||
update.schedule(message)
|
||||
return callback
|
||||
|
||||
Reference in New Issue
Block a user