Class TestBrainUpdater
The test bot brain updater.
Implements
Inherited Members
Namespace: Microsoft.XboxStudios.BotBrain.Samples.ClassBased
Assembly: BotBrain.Samples.dll
Syntax
public class TestBrainUpdater : BrainUpdaterBase<TestGameState, TestAutomatedBot, TestAction>, IBrainUpdater
Remarks
Initializes a new instance of the TestBrainUpdater class.
Constructors
View SourceTestBrainUpdater(IBrainSerializer, IDeviceProvider?, ILogger<TestBrainUpdater>?)
The test bot brain updater.
Declaration
public TestBrainUpdater(IBrainSerializer serializer, IDeviceProvider? deviceProvider = null, ILogger<TestBrainUpdater>? logger = null)
Parameters
Type | Name | Description |
---|---|---|
IBrainSerializer | serializer | The brain serializer. |
IDeviceProvider | deviceProvider | An object that's used to get a DeviceConsole device from its name. |
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<TestGameState> States { get; }
Property Value
Type | Description |
---|---|
IReadOnlyCollection<TestGameState> |
Overrides
Microsoft.XboxStudios.BotBrain.Composition.BrainUpdaterBase<Microsoft.XboxStudios.BotBrain.Samples.ClassBased.TestGameState, Microsoft.XboxStudios.BotBrain.Samples.ClassBased.TestAutomatedBot, Microsoft.XboxStudios.BotBrain.Samples.ClassBased.TestAction>.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, TestGameState, string, int)
Creates a bot.
Declaration
protected override Task<TestAutomatedBot> CreateBotAsync(string deviceName, TestGameState state, string botName, int playerIndex)
Parameters
Type | Name | Description |
---|---|---|
string | deviceName | The device name. |
TestGameState | state | The game state. |
string | botName | The bot's name. |
int | playerIndex | The bot's player index. |
Returns
Type | Description |
---|---|
Task<TestAutomatedBot> | The bot. |