refactor: move modeltypes to own folder, move IDs to file of respective type

This commit is contained in:
spiral
2021-08-07 16:39:32 -04:00
parent 4c17ee3d89
commit 26c18d2f48
10 changed files with 107 additions and 105 deletions

View File

@@ -1,6 +1,33 @@
using NodaTime;
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);
public override string ToString() => $"Switch #{Value}";
}
public class PKSwitch
{
public SwitchId Id { get; }