events module¶
Module implementing the event manager (mediator).
See also: http://pygame.org/wiki/tut_design
-
class
events.AgentEnactionEvent(agent, action, valence)¶ Bases:
events.EventClass representing an agent enaction event. This event holds the action and valence of the action the agent enacted.
-
class
events.AgentPreparationEvent(agent, action, valence)¶ Bases:
events.EventClass representing an agent preparation event. This event holds the action and valance of the action the agent prepared.
-
class
events.ControlEvent¶ Bases:
events.EventClass representing a game control event. E.g., notifies the controller to update.
-
class
events.DrawEvent(save_to_file=False)¶ Bases:
events.EventClass representing a game draw event. E.g., notifies views to update.
-
get_save_to_file()¶
-
-
class
events.Event¶ Class representing a game event.
-
class
events.EventListener¶ Class implementing a listener that can be notified of events.
-
notify(event)¶ Notifies the listener of an event.
Parameters: event (events.Event.) – The event the listener should be notified of.
-
-
class
events.EventManager¶ Class implementing coordination between the model, views and controllers.
-
deregister_listener(listener)¶ Deregister a listener from the event manager.
Parameters: listener (events.Listener.) – The listener to deregister.
-
post_event(event)¶ Post an event to be sent to the listeners.
Parameters: event (events.Event.) – The event to send.
-
register_listener(listener)¶ Register a listener with the event manager.
Parameters: listener (events.Listener.) – The listener to register.
-
-
class
events.QuitEvent¶ Bases:
events.EventClass representing a quit event. When this event is sent, the simulation should stop.
-
class
events.TickEvent¶ Bases:
events.EventClass representing a game tick event.
Each tick one step of the simulation will be performed.