Bug fixes, add type name to TypeIdentifier
This commit is contained in:
@@ -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();
|
||||
}
|
||||
Reference in New Issue
Block a user