Event

The event system is responsible for signalling other subsystems to do something

class event.EventSystem.EventSystem

The EventSystem is where events are registered, checked for(based upon a conditional gotten from the self.input method) and reported(and callbacks are called if present).

registerEvent(event, condition, callback=None)

Register an Event object

>>> es = EventSystem()
>>> def callback(input, eventName): return 0
>>> es.registerEvent("Event1", None, callback)
>>> def input(): return None
>>> es.input = input
>>> es.update()
>>> es.eventStack[0][0]
'Event1'
removeEvent(name)

Remove an event of given name

>>> es = EventSystem()
>>> es.registerEvent("Event1", None, None)
>>> es.events["Event1"]
['Event1', None, None]
>>> es.removeEvent("Event1")
>>> es.events["Event1"] == None
True
update()
Check result of self.input() against events, call callbacks and add events to the self.eventEvents list

Previous topic

Display

Next topic

Filesystem

This Page