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.
파일 보기 프로젝트 열기: Bacon41/PantheonPrototype 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
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