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