39 lines
1010 B
C#
Raw Normal View History

2021-09-26 23:18:17 -04:00
using System;
2021-09-26 23:18:17 -04:00
using NodaTime;
2021-08-27 11:03:47 -04:00
namespace PluralKit.Core
{
public readonly struct SwitchId: INumericId<SwitchId, int>
{
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 11:03:47 -04:00
public override string ToString() => $"Switch #{Value}";
}
public class PKSwitch
{
2020-06-14 21:37:04 +02:00
public SwitchId Id { get; }
2021-09-26 23:18:17 -04:00
public Guid Uuid { get; private set; }
2020-06-14 21:37:04 +02:00
public SystemId System { get; set; }
2020-06-13 13:11:08 +02:00
public Instant Timestamp { get; }
}
}