Show / Hide Table of Contents

Class AssignRole

The overmind urge responsible for assigning roles.

Inheritance
object
UrgeBase<OvermindState, OvermindBot, OvermindAction>
OvermindUrgeBase
AssignRole
Implements
IUrge<OvermindState, OvermindBot, OvermindAction>
IUrge
IEquatable<IUrge>
Inherited Members
OvermindUrgeBase.Run(OvermindState, OvermindBot)
UrgeBase<OvermindState, OvermindBot, OvermindAction>.NoUrgeName
UrgeBase<OvermindState, OvermindBot, OvermindAction>.Logger
UrgeBase<OvermindState, OvermindBot, OvermindAction>.Name
UrgeBase<OvermindState, OvermindBot, OvermindAction>.Type
UrgeBase<OvermindState, OvermindBot, OvermindAction>.IsExclusive
UrgeBase<OvermindState, OvermindBot, OvermindAction>.ToString()
UrgeBase<OvermindState, OvermindBot, OvermindAction>.Equals(IUrge)
UrgeBase<OvermindState, OvermindBot, OvermindAction>.Equals(object)
UrgeBase<OvermindState, OvermindBot, OvermindAction>.GetHashCode()
UrgeBase<OvermindState, OvermindBot, OvermindAction>.Run(OvermindState, OvermindBot)
UrgeBase<OvermindState, OvermindBot, OvermindAction>.GetParameter<T>(OvermindBot, string)
UrgeBase<OvermindState, OvermindBot, OvermindAction>.GetParameter<T>(OvermindBot, IEnumerable<string>)
UrgeBase<OvermindState, OvermindBot, OvermindAction>.TryGetParameter<T>(OvermindBot, IEnumerable<string>, out T)
UrgeBase<OvermindState, OvermindBot, OvermindAction>.TryGetParameter<T>(OvermindBot, string, out T)
UrgeBase<OvermindState, OvermindBot, OvermindAction>.GetParameterNames(string)
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 AssignRole : OvermindUrgeBase, IUrge<OvermindState, OvermindBot, OvermindAction>, IUrge, IEquatable<IUrge?>
Remarks

Initializes a new instance of the AssignRole class.

Constructors

View Source

AssignRole(string?, ILogger<AssignRole>?)

The overmind urge responsible for assigning roles.

Declaration
public AssignRole(string? name = null, ILogger<AssignRole>? logger = null)
Parameters
Type Name Description
string name

The urge name.

ILogger<AssignRole> logger

The logger to use.

Remarks

Initializes a new instance of the AssignRole class.

Methods

View Source

AssignToScenario(IDevice, DeviceState, IScenario, OvermindState)

Creates a bot action to assign the device to a scenario.

Declaration
protected virtual OvermindAction? AssignToScenario(IDevice device, DeviceState subbot, IScenario scenario, OvermindState state)
Parameters
Type Name Description
IDevice device

The device.

DeviceState subbot

The device state.

IScenario scenario

The scenario.

OvermindState state

The overmind state.

Returns
Type Description
OvermindAction

An overmind action.

View Source

CanAssignToScenario(IDevice, OvermindBot, IScenario)

Determines if the given device can be assigned to a scenario.

Declaration
protected virtual bool CanAssignToScenario(IDevice device, OvermindBot bot, IScenario scenario)
Parameters
Type Name Description
IDevice device

The device.

OvermindBot bot

The overmind bot.

IScenario scenario

The scenario.

Returns
Type Description
bool

True if the device can be assigned to the scenario.

View Source

CanRunScenario(IScenario, bool)

Determines if the given scenario can run.

Declaration
protected virtual bool CanRunScenario(IScenario scenario, bool isFirst)
Parameters
Type Name Description
IScenario scenario

The scenario.

bool isFirst

True if this is the next scenario in the quality pass.

Returns
Type Description
bool

True if the scenario is next or it can run concurrently.

View Source

DoesScenarioNeedUpdate(IScenario)

Determines if the given scenario needs additional devices to run.

Declaration
protected virtual bool DoesScenarioNeedUpdate(IScenario scenario)
Parameters
Type Name Description
IScenario scenario

The scenario.

Returns
Type Description
bool

True if the scenario doesn't have enough devices to run and isn't finished.

View Source

IsScenarioRunningExclusively(IScenario)

Determines if the given scenario is running and should prevent other scenarios from starting.

Declaration
protected virtual bool IsScenarioRunningExclusively(IScenario scenario)
Parameters
Type Name Description
IScenario scenario

The scenario.

Returns
Type Description
bool

True if the scenario is non-concurrent and running with enough devices.

View Source

RunSync(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
OvermindUrgeBase.RunSync(OvermindState, OvermindBot)

Implements

IUrge<TState, TBot, TAction>
IUrge
IEquatable<T>
  • View Source
In this article
Back to top Generated by DocFX