Show / Hide Table of Contents

Interface IBotBrain<TState, TBot, TAction>

The interface for a bot brain.

Inherited Members
IUrgeList<TState, TBot, TAction>.Urges
IUrge<TState, TBot, TAction>.Run(TState, TBot)
IBotBrain.Logger
IBotBrain.Considerations
IBotBrain.AddConsideration(IConsideration)
IBotBrain.RemoveConsideration(IConsideration)
IBotBrain.Update(object, IReadOnlyCollection<IAutomatedBot>)
IBasedOn<IBotBrain>.BasedOn
IBasedOn<IBotBrain>.BasedOnObject
IEquatable<IBotBrain>.Equals(IBotBrain)
IUrgeList.Urges
IUrgeList.AddUrge(IUrge)
IUrgeList.RemoveUrge(IUrge)
IUrge.Name
IUrge.Type
IUrge.IsExclusive
IEquatable<IUrge>.Equals(IUrge)
IHasParameters.Parameters
Namespace: Microsoft.XboxStudios.BotBrain
Assembly: BotBrain.Core.dll
Syntax
public interface IBotBrain<TState, TBot, TAction> : IUrgeList<TState, TBot, TAction>, IUrge<TState, TBot, TAction>, IBotBrain, IBasedOn<IBotBrain>, IBasedOn, IEquatable<IBotBrain?>, IUrgeList, IUrge, IEquatable<IUrge?>, IHasParameters where TBot : IAutomatedBot<TAction>
Type Parameters
Name Description
TState

A title-specific state object.

TBot

A title-specific bot object that implements IAutomatedBot<TAction>.

TAction

The title-specific bot action that implements IEquatable<T>.

Properties

View Source

Bots

Gets the collection of bots controlled by the brain.

Declaration
IReadOnlyCollection<TBot> Bots { get; }
Property Value
Type Description
IReadOnlyCollection<TBot>

Methods

View Source

GetBotData(TBot)

Gets the bot data for the given bot.

Declaration
BrainBotData<TState, TBot, TAction>? GetBotData(TBot bot)
Parameters
Type Name Description
TBot bot

The bot.

Returns
Type Description
BrainBotData<TState, TBot, TAction>

The bot data.

View Source

Start(TBot, CancellationToken, params TState[])

Starts controlling the bot.

Declaration
void Start(TBot bot, CancellationToken token = default, params TState[] states)
Parameters
Type Name Description
TBot bot

The bot to control.

CancellationToken token

A cancellation token to end the automation.

TState[] states

The states used to update the bot.

View Source

Stop(TBot)

Stops controlling the bot.

Declaration
Task Stop(TBot bot)
Parameters
Type Name Description
TBot bot

The bot to stop controlling.

Returns
Type Description
Task

A task that returns after stopping the bot.

View Source

Update(TState, IReadOnlyCollection<TBot>?)

Updates the state and current action of the given bots.

Declaration
Task Update(TState state, IReadOnlyCollection<TBot>? bots = null)
Parameters
Type Name Description
TState state

The game state.

IReadOnlyCollection<TBot> bots

The bots to update. If null, all controlled bots are updated.

Returns
Type Description
Task

A task that returns after updating each bot.

Events

View Source

OnBotPaused

Occurs when the brain pauses a bot.

Declaration
event EventHandler<TBot>? OnBotPaused
Event Type
Type Description
EventHandler<TBot>
View Source

OnBotStopped

Occurs when the brain stops a bot.

Declaration
event EventHandler<TBot>? OnBotStopped
Event Type
Type Description
EventHandler<TBot>
  • View Source
In this article
Back to top Generated by DocFX