Class ScenarioBase
Base class for scenarios.
Inherited Members
Namespace: Microsoft.XboxStudios.BotBrain.Overmind
Assembly: BotBrain.Overmind.dll
Syntax
public abstract class ScenarioBase : IScenario, IEquatable<IScenario?>, IBasedOn<IScenario>, IBasedOn, IMetadataAccess
Constructors
View SourceScenarioBase(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 SourceNoScenarioName
The name for the lack of a scenario.
Declaration
protected const string NoScenarioName = "None"
Field Value
Type | Description |
---|---|
string |
Properties
View SourceAssignedDevices
Gets an enumeration of devices assigned to this scenario.
Declaration
[JsonIgnore]
public abstract IEnumerable<IDevice> AssignedDevices { get; }
Property Value
Type | Description |
---|---|
IEnumerable<IDevice> |
BasedOn
Gets the name of the template this object is based on.
Declaration
public string? BasedOn { get; set; }
Property Value
Type | Description |
---|---|
string |
BasedOnObject
Gets or sets the template this object is based on.
Declaration
[JsonIgnore]
public IScenario? BasedOnObject { get; set; }
Property Value
Type | Description |
---|---|
IScenario |
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 |
Name
Gets or sets the scenario name.
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
string |
NumDevicesAssigned
Gets a value indicating how many devices this scenario has assigned.
Declaration
[JsonIgnore]
public abstract int NumDevicesAssigned { get; }
Property Value
Type | Description |
---|---|
int |
NumDevicesRequired
Gets a value indicating how many devices this scenario requires.
Declaration
[JsonIgnore]
public abstract int NumDevicesRequired { get; }
Property Value
Type | Description |
---|---|
int |
ParameterNames
Gets an enumeration of parameter names.
Declaration
[JsonIgnore]
public IEnumerable<string> ParameterNames { get; }
Property Value
Type | Description |
---|---|
IEnumerable<string> |
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 |
Type
Gets the type name.
Declaration
public string Type { get; }
Property Value
Type | Description |
---|---|
string |
Methods
View SourceCreateMetadata()
Used to create parameter metadata.
Declaration
protected virtual MetadataContainer CreateMetadata()
Returns
Type | Description |
---|---|
MetadataContainer | A metadata container. |
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 |
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
View SourceFlagFailedIfUnfinished(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. |
GetHashCode()
Serves as the default hash function.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A hash code for the current object. |
Overrides
View SourceGetParameterMetadata(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. |
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
View SourceUpdate(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. |