Class AssignBrain
The overmind urge responsible for assigning brains.
Inheritance
AssignBrain
Inherited Members
Namespace: Microsoft.XboxStudios.BotBrain.Overmind
Assembly: BotBrain.Overmind.dll
Syntax
public class AssignBrain : OvermindUrgeBase, IUrge<OvermindState, OvermindBot, OvermindAction>, IUrge, IEquatable<IUrge?>
Remarks
Initializes a new instance of the AssignBrain class.
Constructors
View SourceAssignBrain(string?, ILogger<AssignBrain>?)
The overmind urge responsible for assigning brains.
Declaration
public AssignBrain(string? name = null, ILogger<AssignBrain>? logger = null)
Parameters
Type | Name | Description |
---|---|---|
string | name | The urge name. |
ILogger<AssignBrain> | logger | The logger to use. |
Remarks
Initializes a new instance of the AssignBrain class.
Methods
View SourceRunSync(OvermindState, OvermindBot)
Runs the urge synchronously.
Declaration
protected override IEnumerable<IRecommendedAction<OvermindAction>> RunSync(OvermindState state, OvermindBot bot)
Parameters
Type | Name | Description |
---|---|---|
OvermindState | state | The game state. |
OvermindBot | bot | The bot to control. |
Returns
Type | Description |
---|---|
IEnumerable<IRecommendedAction<OvermindAction>> | An enumerable of weighted bot actions. |
Overrides
View SourceStartBrain(OvermindState, DeviceState, IScenario, RunBrainRole, CancellationToken)
Starts a bot brain on a device running in the overmind.
Declaration
protected virtual Task<bool> StartBrain(OvermindState state, DeviceState subbot, IScenario scenario, RunBrainRole brainRole, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
OvermindState | state | The overmind state. |
DeviceState | subbot | The device state. |
IScenario | scenario | The scenario. |
RunBrainRole | brainRole | The bot brain role. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task<bool> | True if starting a brain succeeded. |