C# Class EventBroadcaster, PocketGodsRPG_Proto

Mostra file Open project: pocket-playlab/PocketGodsRPG_Proto Class Usage Examples

Public Methods

Method Description
AddObserver ( string notificationName, System action ) : void
AddObserver ( string notificationName, System action ) : void

Adds an observer to listen to specified by notification name

PostEvent ( string notificationName ) : void

Posts an event specified by name that does not require any parameters. Observers associated with this event will be called.

PostEvent ( string notificationName, Parameters, parameters ) : void

Posts an event specified by name that requires parameters. Observers associated with this event will be called. Requires the parameters class to be passed.

PrintObservers ( ) : void
RemoveActionAtObserver ( string notificationName, System action ) : void

Removes the action at observer specified by notification name

RemoveActionAtObserver ( string notificationName, System action ) : void

Removes the action at observer specified by notification name

RemoveAllObservers ( ) : void

Removes all observers.

RemoveObserver ( string notificationName ) : void

Removes all observers under the specified notification name

Private Methods

Method Description
EventBroadcaster ( ) : System.Collections

Method Details

AddObserver() public method

public AddObserver ( string notificationName, System action ) : void
notificationName string
action System
return void

AddObserver() public method

Adds an observer to listen to specified by notification name
public AddObserver ( string notificationName, System action ) : void
notificationName string
action System
return void

PostEvent() public method

Posts an event specified by name that does not require any parameters. Observers associated with this event will be called.
public PostEvent ( string notificationName ) : void
notificationName string
return void

PostEvent() public method

Posts an event specified by name that requires parameters. Observers associated with this event will be called. Requires the parameters class to be passed.
public PostEvent ( string notificationName, Parameters, parameters ) : void
notificationName string
parameters Parameters,
return void

PrintObservers() public method

public PrintObservers ( ) : void
return void

RemoveActionAtObserver() public method

Removes the action at observer specified by notification name
public RemoveActionAtObserver ( string notificationName, System action ) : void
notificationName string Notification name.
action System Action.
return void

RemoveActionAtObserver() public method

Removes the action at observer specified by notification name
public RemoveActionAtObserver ( string notificationName, System action ) : void
notificationName string Notification name.
action System Action.
return void

RemoveAllObservers() public method

Removes all observers.
public RemoveAllObservers ( ) : void
return void

RemoveObserver() public method

Removes all observers under the specified notification name
public RemoveObserver ( string notificationName ) : void
notificationName string Notification name.
return void