PkmnLib.NET/PkmnLib.Static/TypeIdentifier.cs

30 lines
720 B
C#

using PkmnLib.Static.Libraries;
using PkmnLib.Static.Utils;
namespace PkmnLib.Static;
/// <summary>
/// A number that identifies a type. To be used with <see cref="TypeLibrary"/>
/// </summary>
public readonly record struct TypeIdentifier
{
/// <summary>
/// The name of the type identifier.
/// </summary>
public StringKey Name { get; }
/// <summary>
/// The underlying value of the type identifier.
/// </summary>
public byte Value { get; }
/// <inheritdoc cref="TypeIdentifier"/>
public TypeIdentifier(byte value, StringKey name)
{
Value = value;
Name = name;
}
/// <inheritdoc />
public override int GetHashCode() => Value.GetHashCode();
}