Skip to main content

Struct MetricId

Wrapper around an enum with the MetricTypeEnumAttribute. The struct provide a way to create metric that can be used with multiplayer tools.

Implements#

System.IEquatable\<MetricId>

Inherited Members#

System.Object.Equals(System.Object, System.Object)

System.Object.GetType()

System.Object.ReferenceEquals(System.Object, System.Object)

Namespace: Unity.Multiplayer.Tools.NetStats#
Assembly: Tools.dll#
Syntax#
[Serializable]
public struct MetricId : IEquatable<MetricId>

Methods#

Create\<T>(T)#

Static function to create a MetricId.

Declaration#
public static MetricId Create<T>(T value)
where T : struct, IConvertible
Parameters#
TypeNameDescription
TvalueEnum value for the metric.
Returns#
TypeDescription
MetricId
Type Parameters#
NameDescription
TAn enum with the MetricTypeEnumAttribute

Equals(Object)#

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

Declaration#
public override bool Equals(object obj)
Parameters#
TypeNameDescription
System.ObjectobjThe object to compare with the current object..
Returns#
TypeDescription
System.Booleantrue if the specified object is equal to the current object; otherwise, false.
Overrides#

System.ValueType.Equals(System.Object)

Equals(MetricId)#

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

Declaration#
public bool Equals(MetricId other)
Parameters#
TypeNameDescription
MetricIdotherThe MetricId to compare with the current MetricId.
Returns#
TypeDescription
System.Booleantrue if the specified MetricId is equal to the current MetricId; otherwise, false.

GetHashCode()#

Serves as the default hash function.

Declaration#
public override int GetHashCode()
Returns#
TypeDescription
System.Int32A hash code for the current MetricId.
Overrides#

System.ValueType.GetHashCode()

ToString()#

Returns a string that represents the current MetricId.

Declaration#
public override string ToString()
Returns#
TypeDescription
System.StringA string that represents the current MetricId.
Overrides#

System.ValueType.ToString()

Operators#

Implicit(MetricId to String)#

Implicit operator to convert to string.

Declaration#
public static implicit operator string (MetricId metricId)
Parameters#
TypeNameDescription
MetricIdmetricIdThe MetricId to convert to string.
Returns#
TypeDescription
System.StringThe name of the MetricId.

Implements#

System.IEquatable\<T>