Class ConsiderationBase
A base class used to implement IConsideration<TState, TBot, TAction> given parameters for curve type and maximum value.
Inherited Members
Namespace: Microsoft.XboxStudios.BotBrain.Considerations
Assembly: BotBrain.Core.dll
Syntax
[DataContract]
public abstract class ConsiderationBase : IConsideration, IEquatable<IConsideration>
Constructors
View SourceConsiderationBase(string?, ILogger<ConsiderationBase>?)
Initializes a new instance of the ConsiderationBase class.
Declaration
protected ConsiderationBase(string? name = null, ILogger<ConsiderationBase>? logger = null)
Parameters
Type | Name | Description |
---|---|---|
string | name | The consideration name. |
ILogger<ConsiderationBase> | logger | The logger to use. |
Properties
View SourceBrain
Gets or sets the brain using this consideration.
Declaration
public IBotBrain? Brain { get; set; }
Property Value
Type | Description |
---|---|
IBotBrain |
Logger
Gets the logger for the consideration.
Declaration
[IgnoreDataMember]
protected ILogger Logger { get; }
Property Value
Type | Description |
---|---|
ILogger |
Name
Gets or sets the consideration name.
Declaration
[DataMember]
public string Name { get; set; }
Property Value
Type | Description |
---|---|
string |
Type
Gets the type name of the consideration.
Declaration
[DataMember]
public string Type { get; }
Property Value
Type | Description |
---|---|
string |
Methods
View SourceEquals(IConsideration?)
Determines whether the specified consideration is equal to this one.
Declaration
public virtual bool Equals(IConsideration? other)
Parameters
Type | Name | Description |
---|---|---|
IConsideration | other | The consideration to compare to. |
Returns
Type | Description |
---|---|
bool | True if the considerations are equal. |
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 SourceGetCurve(IHasParameters, Func<string, IEnumerable<string>>, out Curve)
Gets the curve parameters.
Declaration
public bool GetCurve(IHasParameters hasParameters, Func<string, IEnumerable<string>> getParameterNames, out Curve curve)
Parameters
Type | Name | Description |
---|---|---|
IHasParameters | hasParameters | The object containing parameter values. |
Func<string, IEnumerable<string>> | getParameterNames | Given an unqualified parameter name, returns all possible names. |
Curve | curve | Used to store the parameter value. |
Returns
Type | Description |
---|---|
bool | True if the parameters were valid. |
GetCurve(IParameterManager, Func<string, IEnumerable<string>>, out Curve)
Gets the curve parameters.
Declaration
public bool GetCurve(IParameterManager parameters, Func<string, IEnumerable<string>> getParameterNames, out Curve curve)
Parameters
Type | Name | Description |
---|---|---|
IParameterManager | parameters | The parameter values. |
Func<string, IEnumerable<string>> | getParameterNames | Given an unqualified parameter name, returns all possible names. |
Curve | curve | Used to store the parameter value. |
Returns
Type | Description |
---|---|
bool | True if the parameters were valid. |
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 SourceGetSignificance(IHasParameters, Func<string, IEnumerable<string>>, out double)
Gets the significance parameter.
Declaration
public bool GetSignificance(IHasParameters hasParameters, Func<string, IEnumerable<string>> getParameterNames, out double significance)
Parameters
Type | Name | Description |
---|---|---|
IHasParameters | hasParameters | The object containing parameter values. |
Func<string, IEnumerable<string>> | getParameterNames | Given an unqualified parameter name, returns all possible names. |
double | significance | Used to store the parameter value. |
Returns
Type | Description |
---|---|
bool | True if the parameter was valid. |
GetSignificance(IParameterManager, Func<string, IEnumerable<string>>, out double)
Gets the significance parameter.
Declaration
public bool GetSignificance(IParameterManager parameters, Func<string, IEnumerable<string>> getParameterNames, out double significance)
Parameters
Type | Name | Description |
---|---|---|
IParameterManager | parameters | The parameter values. |
Func<string, IEnumerable<string>> | getParameterNames | Given an unqualified parameter name, returns all possible names. |
double | significance | Used to store the parameter value. |
Returns
Type | Description |
---|---|
bool | True if the parameter was valid. |
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. |