Bug fixes, add type name to TypeIdentifier

This commit is contained in:
2025-03-07 12:57:06 +01:00
parent 3571b2130e
commit 2c987e32ee
9 changed files with 29 additions and 34 deletions

View File

@@ -1,4 +1,5 @@
using PkmnLib.Static.Libraries;
using PkmnLib.Static.Utils;
namespace PkmnLib.Static;
@@ -7,22 +8,23 @@ namespace PkmnLib.Static;
/// </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)
public TypeIdentifier(byte value, StringKey name)
{
Value = value;
Name = name;
}
/// <summary>
/// Converts a byte to a type identifier.
/// </summary>
public static implicit operator TypeIdentifier(byte value) => new(value);
/// <inheritdoc />
public override int GetHashCode() => Value.GetHashCode();
}