Class TestBrainUpdater
The test bot brain updater.
Implements
Inherited Members
Namespace: Microsoft.XboxStudios.BotBrain.Samples.EnumBased
Assembly: BotBrain.Samples.dll
Syntax
public class TestBrainUpdater : BrainUpdaterBase<bool, TestAutomatedBot, TestBotAction>, IBrainUpdater
Remarks
Initializes a new instance of the TestBrainUpdater class.
Constructors
View SourceTestBrainUpdater(IBrainSerializer, ILogger<TestBrainUpdater>?)
The test bot brain updater.
Declaration
public TestBrainUpdater(IBrainSerializer serializer, ILogger<TestBrainUpdater>? logger = null)
Parameters
Type | Name | Description |
---|---|---|
IBrainSerializer | serializer | The brain serializer. |
ILogger<TestBrainUpdater> | logger | The logger. |
Remarks
Initializes a new instance of the TestBrainUpdater class.
Properties
View SourceStates
Gets the game state objects associated with running bots.
Declaration
public override IReadOnlyCollection<bool> States { get; }
Property Value
Type | Description |
---|---|
IReadOnlyCollection<bool> |
Overrides
Microsoft.XboxStudios.BotBrain.Composition.BrainUpdaterBase<bool, Microsoft.XboxStudios.BotBrain.Samples.EnumBased.TestAutomatedBot, Microsoft.XboxStudios.BotBrain.Samples.EnumBased.TestBotAction>.States
Methods
View SourceAddBotAsync(string, IBotBrain?, string?, int, CancellationToken)
Adds a bot to the brain.
Declaration
public override Task<IAutomatedBot?> AddBotAsync(string deviceName, IBotBrain? brain = null, string? botName = null, int playerIndex = 0, CancellationToken token = default)
Parameters
Type | Name | Description |
---|---|---|
string | deviceName | The device name. |
IBotBrain | brain | The brain to use. |
string | botName | The bot's name. |
int | playerIndex | The bot's player index. |
CancellationToken | token | The cancellation token. |
Returns
Type | Description |
---|---|
Task<IAutomatedBot> | The bot. |
Overrides
View SourceCreateBotAsync(string, bool, string, int)
Creates a bot.
Declaration
protected override Task<TestAutomatedBot> CreateBotAsync(string deviceName, bool state, string botName, int playerIndex)
Parameters
Type | Name | Description |
---|---|---|
string | deviceName | The device name. |
bool | state | The game state. |
string | botName | The bot's name. |
int | playerIndex | The bot's player index. |
Returns
Type | Description |
---|---|
Task<TestAutomatedBot> | The bot. |