From cc1d759290552e87cd3452f82290c68718aa5141 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 22 Oct 2021 17:48:09 +0900 Subject: [PATCH] Remove unnecessary setters from `IBeatmapSetOnlineInfo` interface --- osu.Game/Beatmaps/BeatmapSetInfo.cs | 96 ++++------------------ osu.Game/Beatmaps/IBeatmapSetOnlineInfo.cs | 34 ++++---- 2 files changed, 33 insertions(+), 97 deletions(-) diff --git a/osu.Game/Beatmaps/BeatmapSetInfo.cs b/osu.Game/Beatmaps/BeatmapSetInfo.cs index c3e2399d53..79cd8253f7 100644 --- a/osu.Game/Beatmaps/BeatmapSetInfo.cs +++ b/osu.Game/Beatmaps/BeatmapSetInfo.cs @@ -107,27 +107,15 @@ namespace osu.Game.Beatmaps [NotMapped] [JsonIgnore] - public DateTimeOffset Submitted - { - get => OnlineInfo.Submitted; - set => OnlineInfo.Submitted = value; - } + public DateTimeOffset Submitted => OnlineInfo.Submitted; [NotMapped] [JsonIgnore] - public DateTimeOffset? Ranked - { - get => OnlineInfo.Ranked; - set => OnlineInfo.Ranked = value; - } + public DateTimeOffset? Ranked => OnlineInfo.Ranked; [NotMapped] [JsonIgnore] - public DateTimeOffset? LastUpdated - { - get => OnlineInfo.LastUpdated; - set => OnlineInfo.LastUpdated = value; - } + public DateTimeOffset? LastUpdated => OnlineInfo.LastUpdated; [NotMapped] [JsonIgnore] @@ -135,107 +123,55 @@ namespace osu.Game.Beatmaps [NotMapped] [JsonIgnore] - public bool HasExplicitContent - { - get => OnlineInfo.HasExplicitContent; - set => OnlineInfo.HasExplicitContent = value; - } + public bool HasExplicitContent => OnlineInfo.HasExplicitContent; [NotMapped] [JsonIgnore] - public bool HasVideo - { - get => OnlineInfo.HasVideo; - set => OnlineInfo.HasVideo = value; - } + public bool HasVideo => OnlineInfo.HasVideo; [NotMapped] [JsonIgnore] - public bool HasStoryboard - { - get => OnlineInfo.HasStoryboard; - set => OnlineInfo.HasStoryboard = value; - } + public bool HasStoryboard => OnlineInfo.HasStoryboard; [NotMapped] [JsonIgnore] - public BeatmapSetOnlineCovers Covers - { - get => OnlineInfo.Covers; - set => OnlineInfo.Covers = value; - } + public BeatmapSetOnlineCovers Covers => OnlineInfo.Covers; [NotMapped] [JsonIgnore] - public string Preview - { - get => OnlineInfo.Preview; - set => OnlineInfo.Preview = value; - } + public string Preview => OnlineInfo.Preview; [NotMapped] [JsonIgnore] - public double BPM - { - get => OnlineInfo.BPM; - set => OnlineInfo.BPM = value; - } + public double BPM => OnlineInfo.BPM; [NotMapped] [JsonIgnore] - public int PlayCount - { - get => OnlineInfo.PlayCount; - set => OnlineInfo.PlayCount = value; - } + public int PlayCount => OnlineInfo.PlayCount; [NotMapped] [JsonIgnore] - public int FavouriteCount - { - get => OnlineInfo.FavouriteCount; - set => OnlineInfo.FavouriteCount = value; - } + public int FavouriteCount => OnlineInfo.FavouriteCount; [NotMapped] [JsonIgnore] - public bool HasFavourited - { - get => OnlineInfo.HasFavourited; - set => OnlineInfo.HasFavourited = value; - } + public bool HasFavourited => OnlineInfo.HasFavourited; [NotMapped] [JsonIgnore] - public BeatmapSetOnlineAvailability Availability - { - get => OnlineInfo.Availability; - set => OnlineInfo.Availability = value; - } + public BeatmapSetOnlineAvailability Availability => OnlineInfo.Availability; [NotMapped] [JsonIgnore] - public BeatmapSetOnlineGenre Genre - { - get => OnlineInfo.Genre; - set => OnlineInfo.Genre = value; - } + public BeatmapSetOnlineGenre Genre => OnlineInfo.Genre; [NotMapped] [JsonIgnore] - public BeatmapSetOnlineLanguage Language - { - get => OnlineInfo.Language; - set => OnlineInfo.Language = value; - } + public BeatmapSetOnlineLanguage Language => OnlineInfo.Language; [NotMapped] [JsonIgnore] - public int? TrackId - { - get => OnlineInfo.TrackId; - set => OnlineInfo.TrackId = value; - } + public int? TrackId => OnlineInfo?.TrackId; #endregion } diff --git a/osu.Game/Beatmaps/IBeatmapSetOnlineInfo.cs b/osu.Game/Beatmaps/IBeatmapSetOnlineInfo.cs index b9800bc2e6..1d2bb46bde 100644 --- a/osu.Game/Beatmaps/IBeatmapSetOnlineInfo.cs +++ b/osu.Game/Beatmaps/IBeatmapSetOnlineInfo.cs @@ -15,87 +15,87 @@ namespace osu.Game.Beatmaps /// /// The date this beatmap set was submitted to the online listing. /// - DateTimeOffset Submitted { get; set; } + DateTimeOffset Submitted { get; } /// /// The date this beatmap set was ranked. /// - DateTimeOffset? Ranked { get; set; } + DateTimeOffset? Ranked { get; } /// /// The date this beatmap set was last updated. /// - DateTimeOffset? LastUpdated { get; set; } + DateTimeOffset? LastUpdated { get; } /// /// The status of this beatmap set. /// - BeatmapSetOnlineStatus Status { get; set; } + BeatmapSetOnlineStatus Status { get; } /// /// Whether or not this beatmap set has explicit content. /// - bool HasExplicitContent { get; set; } + bool HasExplicitContent { get; } /// /// Whether or not this beatmap set has a background video. /// - bool HasVideo { get; set; } + bool HasVideo { get; } /// /// Whether or not this beatmap set has a storyboard. /// - bool HasStoryboard { get; set; } + bool HasStoryboard { get; } /// /// The different sizes of cover art for this beatmap set. /// - BeatmapSetOnlineCovers Covers { get; set; } + BeatmapSetOnlineCovers Covers { get; } /// /// A small sample clip of this beatmap set's song. /// - string Preview { get; set; } + string Preview { get; } /// /// The beats per minute of this beatmap set's song. /// - double BPM { get; set; } + double BPM { get; } /// /// The amount of plays this beatmap set has. /// - int PlayCount { get; set; } + int PlayCount { get; } /// /// The amount of people who have favourited this beatmap set. /// - int FavouriteCount { get; set; } + int FavouriteCount { get; } /// /// Whether this beatmap set has been favourited by the current user. /// - bool HasFavourited { get; set; } + bool HasFavourited { get; } /// /// The availability of this beatmap set. /// - BeatmapSetOnlineAvailability Availability { get; set; } + BeatmapSetOnlineAvailability Availability { get; } /// /// The song genre of this beatmap set. /// - BeatmapSetOnlineGenre Genre { get; set; } + BeatmapSetOnlineGenre Genre { get; } /// /// The song language of this beatmap set. /// - BeatmapSetOnlineLanguage Language { get; set; } + BeatmapSetOnlineLanguage Language { get; } /// /// The track ID of this beatmap set. /// Non-null only if the track is linked to a featured artist track entry. /// - int? TrackId { get; set; } + int? TrackId { get; } } }