0.2.0-dev Download ZIP
33 lines ·862 B Raw
| 1 | namespace EvilEngine.Formats.Records; |
| 2 | |
| 3 | public static class AlbumRecords |
| 4 | { |
| 5 | public const string Set = "records/albums"; |
| 6 | } |
| 7 | |
| 8 | public sealed record AlbumTrack(ContentId Music) |
| 9 | { |
| 10 | public string? Title { get; init; } |
| 11 | |
| 12 | public int? Number { get; init; } |
| 13 | } |
| 14 | |
| 15 | public sealed record AlbumRecord(ContentId Id, string Title, string Game) |
| 16 | { |
| 17 | public ContentId? Cover { get; init; } |
| 18 | |
| 19 | public string? Store { get; init; } |
| 20 | |
| 21 | public IReadOnlyList<AlbumTrack> Tracks { get; init; } = []; |
| 22 | |
| 23 | public bool Equals(AlbumRecord? other) |
| 24 | { |
| 25 | return other is not null && Id == other.Id && Title == other.Title && Game == other.Game && |
| 26 | Cover == other.Cover && Store == other.Store && Tracks.SequenceEqual(other.Tracks); |
| 27 | } |
| 28 | |
| 29 | public override int GetHashCode() |
| 30 | { |
| 31 | return HashCode.Combine(Id, Title, Game, Cover, Tracks.Count); |
| 32 | } |
| 33 | } |