// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; using System.Collections.Generic; using osu.Framework.Testing; using osu.Game.Beatmaps; using osu.Game.Database; using osu.Game.Models; using osu.Game.Rulesets; using osu.Game.Users; using Realms; #nullable enable namespace osu.Game.Scoring { [ExcludeFromDynamicCompile] [MapTo("Score")] public class ScoreInfo : RealmObject, IHasGuidPrimaryKey, IHasRealmFiles, ISoftDelete, IEquatable, IScoreInfo { [PrimaryKey] public Guid ID { get; set; } = Guid.NewGuid(); public IList Files { get; } = null!; public string Hash { get; set; } = string.Empty; public bool DeletePending { get; set; } public bool Equals(ScoreInfo other) => other.ID == ID; [Indexed] public long OnlineID { get; set; } = -1; public RealmUser User { get; set; } = null!; public long TotalScore { get; set; } public int MaxCombo { get; set; } public double Accuracy { get; set; } public bool HasReplay { get; set; } public DateTimeOffset Date { get; set; } public double? PP { get; set; } public RealmBeatmap Beatmap { get; set; } = null!; public RealmRuleset Ruleset { get; set; } = null!; public ScoreRank Rank { get => (ScoreRank)RankInt; set => RankInt = (int)value; } [MapTo(nameof(Rank))] public int RankInt { get; set; } IRulesetInfo IScoreInfo.Ruleset => Ruleset; IBeatmapInfo IScoreInfo.Beatmap => Beatmap; IUser IScoreInfo.User => User; IEnumerable IHasNamedFiles.Files => Files; } }