mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 13:06:50 +00:00
feat: upgrade to .NET 6, refactor everything
This commit is contained in:
parent
d28e99ba43
commit
1918c56937
314 changed files with 27954 additions and 27966 deletions
|
|
@ -1,39 +1,35 @@
|
|||
using System;
|
||||
|
||||
using NodaTime;
|
||||
|
||||
namespace PluralKit.Core
|
||||
namespace PluralKit.Core;
|
||||
|
||||
public readonly struct SwitchId: INumericId<SwitchId, int>
|
||||
{
|
||||
public int Value { get; }
|
||||
|
||||
public readonly struct SwitchId: INumericId<SwitchId, int>
|
||||
public SwitchId(int value)
|
||||
{
|
||||
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}";
|
||||
Value = value;
|
||||
}
|
||||
|
||||
public class PKSwitch
|
||||
{
|
||||
public SwitchId Id { get; }
|
||||
public Guid Uuid { get; private set; }
|
||||
public SystemId System { get; set; }
|
||||
public Instant Timestamp { get; }
|
||||
}
|
||||
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; }
|
||||
public Guid Uuid { get; private set; }
|
||||
public SystemId System { get; set; }
|
||||
public Instant Timestamp { get; }
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue