mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 13:06:50 +00:00
refactor: move modeltypes to own folder, move IDs to file of respective type
This commit is contained in:
parent
4c17ee3d89
commit
26c18d2f48
10 changed files with 107 additions and 105 deletions
|
|
@ -4,7 +4,34 @@ using Newtonsoft.Json;
|
|||
|
||||
using NodaTime;
|
||||
|
||||
|
||||
|
||||
namespace PluralKit.Core {
|
||||
|
||||
public readonly struct SystemId: INumericId<SystemId, int>
|
||||
{
|
||||
public int Value { get; }
|
||||
|
||||
public SystemId(int value)
|
||||
{
|
||||
Value = value;
|
||||
}
|
||||
|
||||
public bool Equals(SystemId other) => Value == other.Value;
|
||||
|
||||
public override bool Equals(object obj) => obj is SystemId other && Equals(other);
|
||||
|
||||
public override int GetHashCode() => Value;
|
||||
|
||||
public static bool operator ==(SystemId left, SystemId right) => left.Equals(right);
|
||||
|
||||
public static bool operator !=(SystemId left, SystemId right) => !left.Equals(right);
|
||||
|
||||
public int CompareTo(SystemId other) => Value.CompareTo(other.Value);
|
||||
|
||||
public override string ToString() => $"System #{Value}";
|
||||
}
|
||||
|
||||
public class PKSystem
|
||||
{
|
||||
// Additions here should be mirrored in SystemStore::Save
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue