Class RequirementBase
Base class for requirements.
Inherited Members
Namespace: Microsoft.XboxStudios.BotBrain.Overmind
Assembly: BotBrain.Overmind.dll
Syntax
public abstract class RequirementBase : IRequirement, IEquatable<IRequirement?>, IMetadataAccess
Constructors
View SourceRequirementBase(string?)
Initializes a new instance of the RequirementBase class.
Declaration
protected RequirementBase(string? name = null)
Parameters
Type | Name | Description |
---|---|---|
string | name | The requirement name. |
Properties
View SourceName
Gets the requirement name.
Declaration
public string? Name { get; }
Property Value
Type | Description |
---|---|
string |
ParameterNames
Gets an enumeration of parameter names.
Declaration
[JsonIgnore]
public IEnumerable<string> ParameterNames { get; }
Property Value
Type | Description |
---|---|
IEnumerable<string> |
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(IRequirement?)
Indicates whether the current object is equal to another object of the same type.
Declaration
public virtual bool Equals(IRequirement? other)
Parameters
Type | Name | Description |
---|---|---|
IRequirement | 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 SourceGetHashCode()
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. |
OnStarted(IRoleBasedScenario, OvermindState)
Called when the scenario starts.
Declaration
public virtual void OnStarted(IRoleBasedScenario scenario, OvermindState state)
Parameters
Type | Name | Description |
---|---|---|
IRoleBasedScenario | scenario | The scenario. |
OvermindState | state | The overmind state. |
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(IRoleBasedScenario, OvermindState)
Determines if the requirement is satisfied.
Declaration
public abstract bool Update(IRoleBasedScenario scenario, OvermindState state)
Parameters
Type | Name | Description |
---|---|---|
IRoleBasedScenario | scenario | The scenario. |
OvermindState | state | The overmind state. |
Returns
Type | Description |
---|---|
bool | True if it's satisfied. |