PkmnLib.NET/PkmnLib.Static/TypeIdentifier.cs

30 lines
720 B
C#
Raw Normal View History

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