Further work on static side
This commit is contained in:
@@ -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();
|
||||
}
|
||||
Reference in New Issue
Block a user