Class OvermindActionDelegate
A bot action that runs a delegate.
Implements
Inherited Members
Namespace: Microsoft.XboxStudios.BotBrain.Overmind
Assembly: BotBrain.Overmind.dll
Syntax
public class OvermindActionDelegate : OvermindAction, ICancellableOperation<OvermindBot>, IOperation<OvermindBot>, ICancellableOperation, IOperation
Remarks
Initializes a new instance of the OvermindActionDelegate class.
Constructors
View SourceOvermindActionDelegate(string, Func<OvermindBot, CancellationToken, Task<bool>>, params IDevice[])
A bot action that runs a delegate.
Declaration
public OvermindActionDelegate(string name, Func<OvermindBot, CancellationToken, Task<bool>> run, params IDevice[] targets)
Parameters
Type | Name | Description |
---|---|---|
string | name | The action name. |
Func<OvermindBot, CancellationToken, Task<bool>> | run | The delegate to run. |
IDevice[] | targets | The devices to target. |
Remarks
Initializes a new instance of the OvermindActionDelegate class.
Properties
View SourceTargets
Gets an enumeration of devices to apply this action to.
Declaration
public override IEnumerable<IDevice> Targets { get; }
Property Value
Type | Description |
---|---|
IEnumerable<IDevice> |
Overrides
Methods
View SourceExecuteOn(OvermindBot, CancellationToken)
Runs the operation on an item.
Declaration
protected override Task<bool> ExecuteOn(OvermindBot item, CancellationToken token)
Parameters
Type | Name | Description |
---|---|---|
OvermindBot | item | The item. |
CancellationToken | token | A token to monitor for cancellation. |
Returns
Type | Description |
---|---|
Task<bool> | A task that returns a boolean indicating success or failure when the operation completes. |