Class RoleBase
Base class for roles.
Inherited Members
Namespace: Microsoft.XboxStudios.BotBrain.Overmind
Assembly: BotBrain.Overmind.dll
Syntax
public abstract class RoleBase : IRole, IEquatable<IRole>, IBasedOn<IRole>, IBasedOn, IMetadataAccess
Constructors
View SourceRoleBase(string?, int, string?)
Initializes a new instance of the RoleBase class.
Declaration
protected RoleBase(string? name = null, int numDevices = 1, string? basedOn = null)
Parameters
Type | Name | Description |
---|---|---|
string | name | The role name. |
int | numDevices | The number of devices to assign to this role. |
string | basedOn | The name of the template to base the role on. |
Fields
View SourceDefaultNumDevices
The default number of devices.
Declaration
public const int DefaultNumDevices = 1
Field Value
Type | Description |
---|---|
int |
Properties
View SourceBasedOn
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 IRole? BasedOnObject { get; set; }
Property Value
Type | Description |
---|---|
IRole |
Name
Gets the role name.
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
string |
NumDevices
Gets the number of devices that should be assigned this role.
Declaration
public int NumDevices { get; set; }
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> |
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(IRole?)
Indicates whether the current object is equal to another object of the same type.
Declaration
public virtual bool Equals(IRole? other)
Parameters
Type | Name | Description |
---|---|---|
IRole | 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. |
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. |