Class OvermindBrain
The base overmind brain.
Inheritance
Implements
Inherited Members
Namespace: Microsoft.XboxStudios.BotBrain.Overmind
Assembly: BotBrain.Overmind.dll
Syntax
public class OvermindBrain : BotBrain<OvermindState, OvermindBot, OvermindAction>, IBotBrain<OvermindState, OvermindBot, OvermindAction>, IUrgeList<OvermindState, OvermindBot, OvermindAction>, IUrge<OvermindState, OvermindBot, OvermindAction>, IBotBrain, IBasedOn<IBotBrain>, IBasedOn, IEquatable<IBotBrain?>, IUrgeList, IUrge, IEquatable<IUrge?>, IHasParameters
Remarks
Initializes a new instance of the OvermindBrain class.
Constructors
View SourceOvermindBrain(ILogger<OvermindBrain>)
The base overmind brain.
Declaration
public OvermindBrain(ILogger<OvermindBrain> logger)
Parameters
Type | Name | Description |
---|---|---|
ILogger<OvermindBrain> | logger | The logger to use. |
Remarks
Initializes a new instance of the OvermindBrain class.
Methods
View SourceChoose(OvermindState, OvermindBot, IReadOnlyList<BotBrainUrgeResult<OvermindState, OvermindBot, OvermindAction>>)
Chooses the best among a weighted set of urge results.
Declaration
protected override UrgeResult<OvermindState, OvermindBot, OvermindAction>? Choose(OvermindState state, OvermindBot bot, IReadOnlyList<BotBrainUrgeResult<OvermindState, OvermindBot, OvermindAction>> recommendations)
Parameters
Type | Name | Description |
---|---|---|
OvermindState | state | The game state. |
OvermindBot | bot | The bot. |
IReadOnlyList<BotBrainUrgeResult<OvermindState, OvermindBot, OvermindAction>> | recommendations | The recommendations to choose between. |
Returns
Type | Description |
---|---|
UrgeResult<OvermindState, OvermindBot, OvermindAction>? | The selected urge result. |
Overrides
View SourceExecuteUpdate(OvermindState, OvermindBot)
Updates the state and current action of the given bot.
Declaration
protected override Task<bool> ExecuteUpdate(OvermindState state, OvermindBot bot)
Parameters
Type | Name | Description |
---|---|---|
OvermindState | state | The game state. |
OvermindBot | bot | The bot to update. |
Returns
Type | Description |
---|---|
Task<bool> | A task that returns true if the bot action changed. |
Overrides
View SourcePreUpdateState(OvermindState, OvermindBot)
Called before the overmind runs its urges, in order to update scenarios and other state.
Declaration
protected virtual Task PreUpdateState(OvermindState state, OvermindBot bot)
Parameters
Type | Name | Description |
---|---|---|
OvermindState | state | The overmind state. |
OvermindBot | bot | The overmind bot. |
Returns
Type | Description |
---|---|
Task | A Task representing the asynchronous operation. |
RunUrges(OvermindState, OvermindBot)
Gets the urge results for the given bot and state.
Declaration
protected override Task<IEnumerable<UrgeResult<OvermindState, OvermindBot, OvermindAction>>> RunUrges(OvermindState state, OvermindBot bot)
Parameters
Type | Name | Description |
---|---|---|
OvermindState | state | The game state. |
OvermindBot | bot | The bot to control. |
Returns
Type | Description |
---|---|
Task<IEnumerable<UrgeResult<OvermindState, OvermindBot, OvermindAction>>> | A task returning an enumerable of urge results. |
Overrides
View SourceUpdateScenarios(OvermindState, OvermindBot)
Updates the active scenarios.
Declaration
protected virtual void UpdateScenarios(OvermindState state, OvermindBot bot)
Parameters
Type | Name | Description |
---|---|---|
OvermindState | state | The overmind state. |
OvermindBot | bot | The overmind bot. |