Show / Hide Table of Contents

Class ScenarioBase

Base class for scenarios.

Inheritance
object
ScenarioBase
RoleBasedScenario
Implements
IScenario
IEquatable<IScenario>
IBasedOn<IScenario>
IBasedOn
IMetadataAccess
Inherited Members
object.Equals(object, object)
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
Namespace: Microsoft.XboxStudios.BotBrain.Overmind
Assembly: BotBrain.Overmind.dll
Syntax
public abstract class ScenarioBase : IScenario, IEquatable<IScenario?>, IBasedOn<IScenario>, IBasedOn, IMetadataAccess

Constructors

View Source

ScenarioBase(string?, string?, bool?)

Initializes a new instance of the ScenarioBase class.

Declaration
protected ScenarioBase(string? name = null, string? basedOn = null, bool? isConcurrent = null)
Parameters
Type Name Description
string name

The scenario name.

string basedOn

The name of the template to base the role on.

bool? isConcurrent

Whether or not to run the scenario concurrently.

Fields

View Source

NoScenarioName

The name for the lack of a scenario.

Declaration
protected const string NoScenarioName = "None"
Field Value
Type Description
string

Properties

View Source

AssignedDevices

Gets an enumeration of devices assigned to this scenario.

Declaration
[JsonIgnore]
public abstract IEnumerable<IDevice> AssignedDevices { get; }
Property Value
Type Description
IEnumerable<IDevice>
View Source

BasedOn

Gets the name of the template this object is based on.

Declaration
public string? BasedOn { get; set; }
Property Value
Type Description
string
View Source

BasedOnObject

Gets or sets the template this object is based on.

Declaration
[JsonIgnore]
public IScenario? BasedOnObject { get; set; }
Property Value
Type Description
IScenario
View Source

IsConcurrent

Gets or sets a value indicating whether or not this scenario can run concurrently.

Declaration
public bool IsConcurrent { get; set; }
Property Value
Type Description
bool
View Source

Name

Gets or sets the scenario name.

Declaration
public string Name { get; set; }
Property Value
Type Description
string
View Source

NumDevicesAssigned

Gets a value indicating how many devices this scenario has assigned.

Declaration
[JsonIgnore]
public abstract int NumDevicesAssigned { get; }
Property Value
Type Description
int
View Source

NumDevicesRequired

Gets a value indicating how many devices this scenario requires.

Declaration
[JsonIgnore]
public abstract int NumDevicesRequired { get; }
Property Value
Type Description
int
View Source

ParameterNames

Gets an enumeration of parameter names.

Declaration
[JsonIgnore]
public IEnumerable<string> ParameterNames { get; }
Property Value
Type Description
IEnumerable<string>
View Source

Status

Gets a value indicating whether this scenario is queued, started or finished.

Declaration
[JsonIgnore]
public abstract ScenarioStatus Status { get; }
Property Value
Type Description
ScenarioStatus
View Source

Type

Gets the type name.

Declaration
public string Type { get; }
Property Value
Type Description
string

Methods

View Source

CreateMetadata()

Used to create parameter metadata.

Declaration
protected virtual MetadataContainer CreateMetadata()
Returns
Type Description
MetadataContainer

A metadata container.

View Source

Equals(IScenario?)

Indicates whether the current object is equal to another object of the same type.

Declaration
public virtual bool Equals(IScenario? other)
Parameters
Type Name Description
IScenario other

An object to compare with this object.

Returns
Type Description
bool

true if the current object is equal to the other parameter; otherwise, false.

View Source

Equals(object?)

Determines whether the specified object is equal to the current object.

Declaration
public override bool Equals(object? obj)
Parameters
Type Name Description
object obj

The object to compare with the current object.

Returns
Type Description
bool

true if the specified object is equal to the current object; otherwise, false.

Overrides
object.Equals(object)
View Source

FlagFailedIfUnfinished(OvermindState)

Checks the scenario to see if it finished, and if not then flag it as failed.

Declaration
public abstract void FlagFailedIfUnfinished(OvermindState state)
Parameters
Type Name Description
OvermindState state

The overmind state.

View Source

GetHashCode()

Serves as the default hash function.

Declaration
public override int GetHashCode()
Returns
Type Description
int

A hash code for the current object.

Overrides
object.GetHashCode()
View Source

GetParameterMetadata(string)

Gets the metadata for a parameter.

Declaration
public ParameterMetadata? GetParameterMetadata(string parameterName)
Parameters
Type Name Description
string parameterName

The parameter name.

Returns
Type Description
ParameterMetadata

The metadata, if it exists.

View Source

ToString()

Returns a string that represents the current object.

Declaration
public override string ToString()
Returns
Type Description
string

A string that represents the current object.

Overrides
object.ToString()
View Source

Update(OvermindState)

Called to update the scenario based on the overmind state.

Declaration
public abstract void Update(OvermindState state)
Parameters
Type Name Description
OvermindState state

The overmind state.

Implements

IScenario
IEquatable<T>
IBasedOn<T>
IBasedOn
IMetadataAccess

Extension Methods

IScenarioExtensions.HasEnoughDevices(IScenario)
IScenarioExtensions.IsActive(IScenario)
IScenarioExtensions.IsFinished(IScenario)
  • View Source
In this article
Back to top Generated by DocFX