Show / Hide Table of Contents

Class AutomatedBot<TBot, TAction>

The implementation of a bot that performs actions as operations.

Inheritance
object
EventPublisher<BotActionEventArgs>
BotWithEvents<TAction>
AutomatedBotBase<TAction>
AutomatedBot<TBot, TAction>
DeviceBot
OvermindBot
TestAutomatedBot
TestAutomatedBot
Implements
IEventPublisher<BotActionEventArgs>
IBotWithEvents<TAction>
IBotWithEvents
IBotWithQueue<TAction>
IBotWithQueue
IAutomatedBot<TAction>
IAutomatedBot
IHasParameters
IDisposable
Inherited Members
AutomatedBotBase<TAction>.QueueStarted
AutomatedBotBase<TAction>.QueueStopped
AutomatedBotBase<TAction>.StopAfterError
AutomatedBotBase<TAction>.IsRunning
AutomatedBotBase<TAction>.CurrentAction
AutomatedBotBase<TAction>.QueueIndex
AutomatedBotBase<TAction>.QueueCount
AutomatedBotBase<TAction>.Start()
AutomatedBotBase<TAction>.Start(int)
AutomatedBotBase<TAction>.Stop()
AutomatedBotBase<TAction>.Reset()
AutomatedBotBase<TAction>.Dispose()
AutomatedBotBase<TAction>.SetActions(IEnumerable<TAction>)
AutomatedBotBase<TAction>.OnQueueStarted()
AutomatedBotBase<TAction>.OnQueueStopped()
AutomatedBotBase<TAction>.HandleActionFailed(TAction, Exception)
BotWithEvents<TAction>.ActionStarted
BotWithEvents<TAction>.ActionFailed
BotWithEvents<TAction>.ActionFinished
BotWithEvents<TAction>.Name
BotWithEvents<TAction>.CurrentUrge
BotWithEvents<TAction>.Parameters
BotWithEvents<TAction>.ToString()
BotWithEvents<TAction>.OnActionStarted()
BotWithEvents<TAction>.OnActionFinished(TAction)
BotWithEvents<TAction>.OnActionFailed(TAction, Exception)
EventPublisher<BotActionEventArgs>.Publish(object, BotActionEventArgs)
EventPublisher<BotActionEventArgs>.EventReceived
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
Namespace: Microsoft.XboxStudios.BotBrain.Operations
Assembly: BotBrain.Operations.dll
Syntax
public class AutomatedBot<TBot, TAction> : AutomatedBotBase<TAction>, IEventPublisher<BotActionEventArgs>, IBotWithEvents<TAction>, IBotWithEvents, IBotWithQueue<TAction>, IBotWithQueue, IAutomatedBot<TAction>, IAutomatedBot, IHasParameters, IDisposable where TBot : AutomatedBot<TBot, TAction>
Type Parameters
Name Description
TBot

The bot type.

TAction

The action type.

Methods

View Source

GetOperation(TAction)

Gets the operation used to perform the given action.

Declaration
protected virtual IOperation<TBot> GetOperation(TAction action)
Parameters
Type Name Description
TAction action

The action.

Returns
Type Description
IOperation<TBot>

The operation.

View Source

StartExecution(IOperation<TBot>, CancellationToken)

Starts executing an operation on this bot.

Declaration
protected Task<bool> StartExecution(IOperation<TBot> operation, CancellationToken token)
Parameters
Type Name Description
IOperation<TBot> operation

The operation.

CancellationToken token

A token to monitor for cancellation.

Returns
Type Description
Task<bool>

True if the operation was successful.

View Source

StartExecution<T>(IOperation<T>, T, CancellationToken)

Starts executing an operation on this bot.

Declaration
protected Task<bool> StartExecution<T>(IOperation<T> operation, T item, CancellationToken token)
Parameters
Type Name Description
IOperation<T> operation

The operation.

T item

The item to use.

CancellationToken token

A token to monitor for cancellation.

Returns
Type Description
Task<bool>

True if the operation was successful.

Type Parameters
Name Description
T

The context to run the operation in.

View Source

StartOrResumeExecution(TAction, CancellationToken)

Starts executing the action on this bot, or waits for it to finish if it's already running.

Declaration
protected override Task<bool> StartOrResumeExecution(TAction operation, CancellationToken token)
Parameters
Type Name Description
TAction operation

The action.

CancellationToken token

A token to monitor for cancellation.

Returns
Type Description
Task<bool>

True if the operation was successful.

Overrides
AutomatedBotBase<TAction>.StartOrResumeExecution(TAction, CancellationToken)
View Source

StartOrResumeExecution<T>(IOperation<T>, T, CancellationToken)

Starts executing an operation on this bot, or waits for it to finish if it's already running.

Declaration
protected Task<bool> StartOrResumeExecution<T>(IOperation<T> operation, T item, CancellationToken token)
Parameters
Type Name Description
IOperation<T> operation

The operation.

T item

The item to use.

CancellationToken token

A token to monitor for cancellation.

Returns
Type Description
Task<bool>

True if the operation was successful.

Type Parameters
Name Description
T

The context to run the operation in.

Implements

Microsoft.XboxStudios.GameStateTracker.Events.IEventPublisher<T>
IBotWithEvents<TAction>
IBotWithEvents
IBotWithQueue<T>
IBotWithQueue
IAutomatedBot<TAction>
IAutomatedBot
IHasParameters
IDisposable

Extension Methods

IBotWithEventsExtensions.WaitForActionFinished(IBotWithEvents, Func<Task>?, CancellationToken)
IBotWithEventsExtensions.RunAction<T>(IBotWithEvents<T>, T, CancellationToken)
IBotWithQueueExtensions.WaitForQueueStopped(IBotWithQueue, Func<Task>?, CancellationToken)
IEventPublisherExtensions.WaitForAsync<T>(IEventPublisher<T>, Func<T, bool>?, CancellationToken)
  • View Source
In this article
Back to top Generated by DocFX