Further work on static side

This commit is contained in:
2024-07-20 16:12:39 +02:00
parent 3845f91601
commit 1b501dee7e
29 changed files with 670 additions and 155 deletions

View File

@@ -1,15 +1,28 @@
using PkmnLib.Static.Libraries;
namespace PkmnLib.Static;
/// <summary>
/// A number that identifies a type. To be used with <see cref="TypeLibrary"/>
/// </summary>
public readonly record struct TypeIdentifier
{
private byte Value { get; init; }
/// <summary>
/// The underlying value of the type identifier.
/// </summary>
public byte Value { get; }
/// <inheritdoc cref="TypeIdentifier"/>
public TypeIdentifier(byte value)
{
Value = value;
}
/// <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();
}