PluralKit/PluralKit.Core/Models/PKSwitch.cs

35 lines
904 B
C#
Raw Permalink Normal View History

2021-09-27 03:18:17 +00:00
using NodaTime;
namespace PluralKit.Core;
public readonly struct SwitchId: INumericId<SwitchId, int>
2021-08-27 15:03:47 +00:00
{
public int Value { get; }
public SwitchId(int value)
{
Value = value;
}
public bool Equals(SwitchId other) => Value == other.Value;
public override bool Equals(object obj) => obj is SwitchId other && Equals(other);
public override int GetHashCode() => Value;
public static bool operator ==(SwitchId left, SwitchId right) => left.Equals(right);
public static bool operator !=(SwitchId left, SwitchId right) => !left.Equals(right);
public int CompareTo(SwitchId other) => Value.CompareTo(other.Value);
2021-08-27 15:03:47 +00:00
public override string ToString() => $"Switch #{Value}";
}
public class PKSwitch
{
public SwitchId Id { get; }
public Guid Uuid { get; private set; }
public SystemId System { get; set; }
public Instant Timestamp { get; }
}