C# Class PantheonPrototype.EventManager

Distributes events to the correct locations in Pantheon. Classes should register functions with the EventManager to handle specific types of events. When an event occurs, the type is identified, and all registered functions are called. They are passed the event, whose payload gives any other relevant information to the recipient.
Exibir arquivo Open project: Bacon41/PantheonPrototype Class Usage Examples

Public Properties

Property Type Description
GameReference Pantheon

Public Methods

Method Description
EventManager ( ) : System

Temporary constructor for instansiating the list of events.

EventManager ( Pantheon gameReference ) : System
notify ( Event eventInfo ) : void

Notifies the appropriate handlers of an Event.

register ( string type, HandleEvent handler ) : void

Registers an event handling function with the EventManager class. When the EventManager receives an event of the given type, the given handler will be called.

unregister ( string type, HandleEvent handler ) : void

Unregisters the given event handler with the given type of event notification.

Method Details

EventManager() public method

Temporary constructor for instansiating the list of events.
public EventManager ( ) : System
return System

EventManager() public method

public EventManager ( Pantheon gameReference ) : System
gameReference Pantheon
return System

notify() public method

Notifies the appropriate handlers of an Event.
public notify ( Event eventInfo ) : void
eventInfo Event Information about the event.
return void

register() public method

Registers an event handling function with the EventManager class. When the EventManager receives an event of the given type, the given handler will be called.
public register ( string type, HandleEvent handler ) : void
type string A string denoting the event type to trigger the handler.
handler HandleEvent The handler function declared in the form: void EventHandler (Event eventInfo);
return void

unregister() public method

Unregisters the given event handler with the given type of event notification.
public unregister ( string type, HandleEvent handler ) : void
type string The type of event from which to remove the handler.
handler HandleEvent The handler to remove from the notification list.
return void

Property Details

GameReference public_oe property

Event manager passes the game reference into events as they pass through it. That way, we can inject Pantheon references where ever we want... somewhat like the Bunyaviridae virus... except a lot less like a living organism.
public Pantheon,PantheonPrototype GameReference
return Pantheon