Class ArubaCommand
A command that can be performed given an IGameClient and a parameter string. This is not mutable, i.e. all properties must be specified through the constructor.
Inherited Members
Namespace: Microsoft.Internal.Studios.Aruba.Infrastructure
Assembly: Aruba.Infrastructure.dll
Syntax
public class ArubaCommand
Remarks
Initializes a new instance of the ArubaCommand class.
Constructors
View SourceArubaCommand(string, string, bool, Func<IGameClient, string, bool>, Func<IGameClient, string, Task>)
A command that can be performed given an IGameClient and a parameter string. This is not mutable, i.e. all properties must be specified through the constructor.
Declaration
public ArubaCommand(string friendlyName, string description, bool requiresGameClient, Func<IGameClient, string, bool> canExecute, Func<IGameClient, string, Task> execute)
Parameters
Type | Name | Description |
---|---|---|
string | friendlyName | The friendly name used to represent the command in the UI. |
string | description | The description of the command to show in the UI. |
bool | requiresGameClient | Whether this command requires a game client in order to execute. |
Func<IGameClient, string, bool> | canExecute | Whether the command can be executed. |
Func<IGameClient, string, Task> | execute | The task to execute the command. |
Remarks
Initializes a new instance of the ArubaCommand class.
Properties
View SourceCanExecute
Gets a function used to check if the command can be executed.
Declaration
public Func<IGameClient, string, bool> CanExecute { get; }
Property Value
Type | Description |
---|---|
Func<IGameClient, string, bool> |
Description
Gets a description of the command to show in the UI.
Declaration
public string Description { get; }
Property Value
Type | Description |
---|---|
string |
Execute
Gets a Func<T, TResult> returning a Task used to execute this.
Declaration
public Func<IGameClient, string, Task> Execute { get; }
Property Value
Type | Description |
---|---|
Func<IGameClient, string, Task> |
FriendlyName
Gets a name that is used to represent the command in the UI.
Declaration
public string FriendlyName { get; }
Property Value
Type | Description |
---|---|
string |
RequiresGameClient
Gets a value indicating whether this command requires a game client. If no game client is required Aruba will not preemptively throw on null client when validating command can run.
Declaration
public bool RequiresGameClient { get; }
Property Value
Type | Description |
---|---|
bool |