Update all EF based models to implement new read only interfaces

This commit is contained in:
Dean Herbert
2021-10-01 16:31:11 +09:00
parent 619dfe0690
commit d309636460
12 changed files with 57 additions and 11 deletions

View File

@ -17,13 +17,14 @@ namespace osu.Game.Beatmaps
{
[ExcludeFromDynamicCompile]
[Serializable]
public class BeatmapInfo : IEquatable<BeatmapInfo>, IHasPrimaryKey
public class BeatmapInfo : IEquatable<BeatmapInfo>, IHasPrimaryKey, IBeatmapInfo
{
public int ID { get; set; }
public int BeatmapVersion;
private int? onlineBeatmapID;
private IRulesetInfo ruleset;
[JsonProperty("id")]
public int? OnlineBeatmapID
@ -187,5 +188,21 @@ namespace osu.Game.Beatmaps
/// Returns a shallow-clone of this <see cref="BeatmapInfo"/>.
/// </summary>
public BeatmapInfo Clone() => (BeatmapInfo)MemberwiseClone();
#region Implementation of IHasOnlineID
public int? OnlineID => ID;
#endregion
#region Implementation of IBeatmapInfo
public string DifficultyName => Version;
IBeatmapMetadataInfo IBeatmapInfo.Metadata => Metadata;
public IBeatmapDifficultyInfo Difficulty => BaseDifficulty;
IRulesetInfo IBeatmapInfo.Ruleset => Ruleset;
public double StarRating => StarDifficulty;
#endregion
}
}