Class SignalBase<TCommandBase, TAction>
Base signal class that provides a shared listener management for simpler derived signals
Inheritance
System.Object
SignalBase<TCommandBase, TAction>
Implements
Namespace: Atlas
Assembly: Atlas.Runtime.dll
Syntax
public class SignalBase<TCommandBase, TAction> : ISignal
Type Parameters
Name | Description |
---|---|
TCommandBase | Base type of command listeners to allow |
TAction | Type of callback listeners to allow |
Constructors
| Improve this Doc View SourceSignalBase()
Constructor
Declaration
public SignalBase()
Fields
| Improve this Doc View Sourcem_commands
Declaration
protected List<TCommandBase> m_commands
Field Value
Type | Description |
---|---|
System.Collections.Generic.List<TCommandBase> |
m_listeners
Declaration
protected List<TAction> m_listeners
Field Value
Type | Description |
---|---|
System.Collections.Generic.List<TAction> |
Methods
| Improve this Doc View SourceAddCommand<TCommand>()
Creates and registeres a command as a listener
Declaration
public void AddCommand<TCommand>()
where TCommand : TCommandBase
Type Parameters
Name | Description |
---|---|
TCommand | Type of command to add |
AddCommand<TCommand>(TCommand)
Registers the given command instance as a listener
Declaration
public void AddCommand<TCommand>(TCommand command)
where TCommand : TCommandBase
Parameters
Type | Name | Description |
---|---|---|
TCommand | command | The command instance to register |
Type Parameters
Name | Description |
---|---|
TCommand | Type of command to add |
AddListener(TAction)
Registers the given callback as a listener
Declaration
public void AddListener(TAction listener)
Parameters
Type | Name | Description |
---|---|---|
TAction | listener | Listener instance to register |
RemoveCommand<TCommand>()
Removes all command instances of the given type
Declaration
public void RemoveCommand<TCommand>()
where TCommand : TCommandBase
Type Parameters
Name | Description |
---|---|
TCommand | Type of commands to remove |
RemoveListener(TAction)
Unregisters the given callback as a listener
Declaration
public void RemoveListener(TAction listener)
Parameters
Type | Name | Description |
---|---|---|
TAction | listener | The callback to unregister |