Interface ICommand<T1, T2, T3, T4>
Interface for creating object-based method callbacks with four argument
Namespace: Atlas
Assembly: Atlas.Runtime.dll
Syntax
public interface ICommand<T1, T2, T3, T4>
Type Parameters
Name | Description |
---|---|
T1 | |
T2 | |
T3 | |
T4 |
Examples
namespace Atlas.Examples
{
public sealed class Example_Command
{
// command declaration
public struct ExampleCommand : ICommand<float>
{
public void Execute( float value )
{
UnityEngine.Debug.LogFormat( "Command executed with value of {0}", value );
}
}
public void OnInjectDependencies( Signal<float> exampleSignal )
{
// instantiate a command object
ExampleCommand command = new ExampleCommand();
// register a command as a listener of the signal
exampleSignal.AddCommand( command );
// ...
// further calls to exampleSignal.Dispatch( float value ) will also
// invoke command.Execute( float value )
}
}
}
Methods
| Improve this Doc View SourceExecute(T1, T2, T3, T4)
Executes the object. When registered with a Signal<T1, T2, T3, T4>, this will get called upon Dispatch(T1, T2, T3, T4)
Declaration
void Execute(T1 arg1, T2 arg2, T3 arg3, T4 arg4)
Parameters
Type | Name | Description |
---|---|---|
T1 | arg1 | |
T2 | arg2 | |
T3 | arg3 | |
T4 | arg4 |
See Also
Signal<T1, T2, T3, T4>