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.
Afficher le fichier Open project: Bacon41/PantheonPrototype Class Usage Examples

Méthodes publiques

Свойство Type Description
GameReference Pantheon

Méthodes publiques

Méthode 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 méthode

Temporary constructor for instansiating the list of events.
public EventManager ( ) : System
Résultat System

EventManager() public méthode

public EventManager ( Pantheon gameReference ) : System
gameReference Pantheon
Résultat System

notify() public méthode

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

register() public méthode

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);
Résultat void

unregister() public méthode

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.
Résultat 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
Résultat Pantheon