mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-07 14:27:54 +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
|
|
@ -1,8 +1,34 @@
|
|||
using NodaTime;
|
||||
|
||||
#nullable enable
|
||||
|
||||
|
||||
namespace PluralKit.Core
|
||||
{
|
||||
public readonly struct GroupId: INumericId<GroupId, int>
|
||||
{
|
||||
public int Value { get; }
|
||||
|
||||
public GroupId(int value)
|
||||
{
|
||||
Value = value;
|
||||
}
|
||||
|
||||
public bool Equals(GroupId other) => Value == other.Value;
|
||||
|
||||
public override bool Equals(object obj) => obj is GroupId other && Equals(other);
|
||||
|
||||
public override int GetHashCode() => Value;
|
||||
|
||||
public static bool operator ==(GroupId left, GroupId right) => left.Equals(right);
|
||||
|
||||
public static bool operator !=(GroupId left, GroupId right) => !left.Equals(right);
|
||||
|
||||
public int CompareTo(GroupId other) => Value.CompareTo(other.Value);
|
||||
|
||||
public override string ToString() => $"Group #{Value}";
|
||||
}
|
||||
|
||||
#nullable enable
|
||||
public class PKGroup
|
||||
{
|
||||
public GroupId Id { get; private set; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue