Show / Hide Table of Contents

Class OvermindState

Represents the overmind bot state.

Inheritance
object
EventPublisher<OvermindEventArgs>
OvermindState
Implements
IEventAggregator<OvermindEventArgs>
IEventPublisher<OvermindEventArgs>
IEventProcessor
Inherited Members
EventPublisher<OvermindEventArgs>.Publish(object, OvermindEventArgs)
EventPublisher<OvermindEventArgs>.EventReceived
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Microsoft.XboxStudios.BotBrain.Overmind
Assembly: BotBrain.Overmind.dll
Syntax
public class OvermindState : EventPublisher<OvermindEventArgs>, IEventAggregator<OvermindEventArgs>, IEventPublisher<OvermindEventArgs>, IEventProcessor

Constructors

View Source

OvermindState(ILogger<OvermindState>, IBrainHelper)

Initializes a new instance of the OvermindState class.

Declaration
public OvermindState(ILogger<OvermindState> logger, IBrainHelper brainHelper)
Parameters
Type Name Description
ILogger<OvermindState> logger

The logger to use.

IBrainHelper brainHelper

The brain helper for sub-bots.

Properties

View Source

BrainHelper

Gets the brain helper for sub-bots.

Declaration
public IBrainHelper BrainHelper { get; }
Property Value
Type Description
IBrainHelper
View Source

Devices

Gets a mapping from each device to sub-bot controlled by this overmind.

Declaration
public IReadOnlyDictionary<IDevice, DeviceState> Devices { get; }
Property Value
Type Description
IReadOnlyDictionary<IDevice, DeviceState>
View Source

FinishedScenarios

Gets the collection of scenarios this overmind has finished.

Declaration
public Collection<IScenario> FinishedScenarios { get; }
Property Value
Type Description
Collection<IScenario>
View Source

Logger

Gets the logger.

Declaration
public ILogger<OvermindState> Logger { get; }
Property Value
Type Description
ILogger<OvermindState>
View Source

RecentEvents

Gets a read-only list of recent events.

Declaration
public IReadOnlyList<OvermindEventArgs> RecentEvents { get; }
Property Value
Type Description
IReadOnlyList<OvermindEventArgs>

Methods

View Source

ClearEvents()

Clears the list of events.

Declaration
public void ClearEvents()
View Source

FinishScenario(IScenario)

Finishes a scenario by removing any assigned devices.

Declaration
public void FinishScenario(IScenario scenario)
Parameters
Type Name Description
IScenario scenario

The scenario.

View Source

GetRoles(IRoleBasedScenario)

Gets an enumeration of assigned roles in a scenario.

Declaration
public IEnumerable<(DeviceState State, IRoleBasedScenario Scenario, IRole? Role)> GetRoles(IRoleBasedScenario scenario)
Parameters
Type Name Description
IRoleBasedScenario scenario

The scenario.

Returns
Type Description
IEnumerable<(DeviceState State, IRoleBasedScenario Scenario, IRole Role)>

Each in-use device's state, scenario, and role.

View Source

GetRoles(OvermindBot)

Gets an enumeration of assigned roles.

Declaration
public IEnumerable<(DeviceState State, IRoleBasedScenario Scenario, IRole? Role)> GetRoles(OvermindBot bot)
Parameters
Type Name Description
OvermindBot bot

The overmind bot.

Returns
Type Description
IEnumerable<(DeviceState State, IRoleBasedScenario Scenario, IRole Role)>

Each in-use device's state, scenario, and role.

View Source

GetRoles(OvermindSettings)

Gets an enumeration of assigned roles.

Declaration
public IEnumerable<(DeviceState State, IRoleBasedScenario Scenario, IRole? Role)> GetRoles(OvermindSettings settings)
Parameters
Type Name Description
OvermindSettings settings

The overmind settings.

Returns
Type Description
IEnumerable<(DeviceState State, IRoleBasedScenario Scenario, IRole Role)>

Each in-use device's state, scenario, and role.

View Source

OnScenarioFailed(IScenario, string?)

Publishes the failed scenario event.

Declaration
public void OnScenarioFailed(IScenario scenario, string? message = null)
Parameters
Type Name Description
IScenario scenario

The scenario that failed.

string message

The reason the scenario failed.

View Source

OnScenarioStarted(IScenario)

Publishes the start scenario event.

Declaration
public void OnScenarioStarted(IScenario scenario)
Parameters
Type Name Description
IScenario scenario

The scenario that is starting.

View Source

ProcessEvents()

Processes an internal buffer of events.

Declaration
public void ProcessEvents()
View Source

Reset(IDevice)

Resets a device's state in the overmind.

Declaration
public void Reset(IDevice device)
Parameters
Type Name Description
IDevice device

The device.

View Source

Update(DeviceState)

Updates a device's state in the overmind.

Declaration
public void Update(DeviceState state)
Parameters
Type Name Description
DeviceState state

The device state.

Implements

Microsoft.XboxStudios.GameStateTracker.Events.IEventAggregator<T>
Microsoft.XboxStudios.GameStateTracker.Events.IEventPublisher<T>
Microsoft.XboxStudios.GameStateTracker.Events.IEventProcessor

Extension Methods

IEventPublisherExtensions.WaitForAsync<T>(IEventPublisher<T>, Func<T, bool>?, CancellationToken)
  • View Source
In this article
  • Constructors
    • OvermindState(ILogger<OvermindState>, IBrainHelper)
  • Properties
    • BrainHelper
    • Devices
    • FinishedScenarios
    • Logger
    • RecentEvents
  • Methods
    • ClearEvents()
    • FinishScenario(IScenario)
    • GetRoles(IRoleBasedScenario)
    • GetRoles(OvermindBot)
    • GetRoles(OvermindSettings)
    • OnScenarioFailed(IScenario, string?)
    • OnScenarioStarted(IScenario)
    • ProcessEvents()
    • Reset(IDevice)
    • Update(DeviceState)
  • Implements
  • Extension Methods
Back to top Generated by DocFX