C# Класс 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.
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
GameReference Pantheon

Открытые методы

Метод Описание
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.

Описание методов

EventManager() публичный Метод

Temporary constructor for instansiating the list of events.
public EventManager ( ) : System
Результат System

EventManager() публичный Метод

public EventManager ( Pantheon gameReference ) : System
gameReference Pantheon
Результат System

notify() публичный Метод

Notifies the appropriate handlers of an Event.
public notify ( Event eventInfo ) : void
eventInfo Event Information about the event.
Результат void

register() публичный Метод

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);
Результат void

unregister() публичный Метод

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.
Результат void

Описание свойств

GameReference публичное свойство

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
Результат Pantheon