Class AutomationQueue<TAction>
An implementation of a bot action queue.
Implements
IList<TAction>
ICollection<TAction>
IReadOnlyList<TAction>
IReadOnlyCollection<TAction>
IEnumerable<TAction>
Inherited Members
Namespace: Microsoft.XboxStudios.BotBrain.Operations
Assembly: BotBrain.Operations.dll
Syntax
public class AutomationQueue<TAction> : List<TAction>, IList<TAction>, ICollection<TAction>, IReadOnlyList<TAction>, IReadOnlyCollection<TAction>, IEnumerable<TAction>, IList, ICollection, IEnumerable, IDisposable
Type Parameters
Name | Description |
---|---|
TAction | The bot action type. |
Properties
View SourceCurrentAction
Gets or sets the current action.
Declaration
public TAction CurrentAction { get; set; }
Property Value
Type | Description |
---|---|
TAction |
CurrentIndex
Gets or sets the index of the current action in the queue.
Declaration
public int CurrentIndex { get; set; }
Property Value
Type | Description |
---|---|
int |
Methods
View SourceDispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
Reset()
Resets the bot's action queue.
Declaration
public Task Reset()
Returns
Type | Description |
---|---|
Task | A task that completes once the bot is reset. |
SafeModifyActions(Action)
Modifies the action queue, using a semaphore for safety.
Declaration
public Task SafeModifyActions(Action action)
Parameters
Type | Name | Description |
---|---|---|
Action | action | The action. |
Returns
Type | Description |
---|---|
Task | A task. |
SafeModifyActions(Func<CancellationToken, Task>, CancellationToken)
Modifies the action queue, using a semaphore for safety.
Declaration
public Task SafeModifyActions(Func<CancellationToken, Task> action, CancellationToken token = default)
Parameters
Type | Name | Description |
---|---|---|
Func<CancellationToken, Task> | action | The action. |
CancellationToken | token | A token to monitor for cancellation. |
Returns
Type | Description |
---|---|
Task | A task. |
SetActions(IEnumerable<TAction>)
Sets the action queue.
Declaration
public Task SetActions(IEnumerable<TAction> actions)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<TAction> | actions | The actions. |
Returns
Type | Description |
---|---|
Task | A task. |