diff --git a/osu.Game.Tests/NonVisual/Filtering/FilterMatchingTest.cs b/osu.Game.Tests/NonVisual/Filtering/FilterMatchingTest.cs index 41939cec3f..743d11541d 100644 --- a/osu.Game.Tests/NonVisual/Filtering/FilterMatchingTest.cs +++ b/osu.Game.Tests/NonVisual/Filtering/FilterMatchingTest.cs @@ -17,7 +17,7 @@ namespace osu.Game.Tests.NonVisual.Filtering private BeatmapInfo getExampleBeatmap() => new BeatmapInfo { Ruleset = new RulesetInfo { ID = 5 }, - StarDifficulty = 4.0d, + StarRating = 4.0d, BaseDifficulty = new BeatmapDifficulty { ApproachRate = 5.0f, diff --git a/osu.Game.Tests/Visual/Multiplayer/TestSceneDrawableRoom.cs b/osu.Game.Tests/Visual/Multiplayer/TestSceneDrawableRoom.cs index 721862c177..2c28a1752e 100644 --- a/osu.Game.Tests/Visual/Multiplayer/TestSceneDrawableRoom.cs +++ b/osu.Game.Tests/Visual/Multiplayer/TestSceneDrawableRoom.cs @@ -59,7 +59,7 @@ namespace osu.Game.Tests.Visual.Multiplayer { BeatmapInfo = { - StarDifficulty = 2.5 + StarRating = 2.5 } }.BeatmapInfo, } @@ -82,7 +82,7 @@ namespace osu.Game.Tests.Visual.Multiplayer { BeatmapInfo = { - StarDifficulty = 2.5, + StarRating = 2.5, Metadata = { Artist = "very very very very very very very very very long artist", @@ -111,7 +111,7 @@ namespace osu.Game.Tests.Visual.Multiplayer { BeatmapInfo = { - StarDifficulty = 2.5 + StarRating = 2.5 } }.BeatmapInfo, } @@ -124,7 +124,7 @@ namespace osu.Game.Tests.Visual.Multiplayer { BeatmapInfo = { - StarDifficulty = 4.5 + StarRating = 4.5 } }.BeatmapInfo, } diff --git a/osu.Game.Tests/Visual/Multiplayer/TestSceneStarRatingRangeDisplay.cs b/osu.Game.Tests/Visual/Multiplayer/TestSceneStarRatingRangeDisplay.cs index cdeafdc9a3..20db922122 100644 --- a/osu.Game.Tests/Visual/Multiplayer/TestSceneStarRatingRangeDisplay.cs +++ b/osu.Game.Tests/Visual/Multiplayer/TestSceneStarRatingRangeDisplay.cs @@ -31,8 +31,8 @@ namespace osu.Game.Tests.Visual.Multiplayer { SelectedRoom.Value.Playlist.AddRange(new[] { - new PlaylistItem { Beatmap = { Value = new BeatmapInfo { StarDifficulty = min } } }, - new PlaylistItem { Beatmap = { Value = new BeatmapInfo { StarDifficulty = max } } }, + new PlaylistItem { Beatmap = { Value = new BeatmapInfo { StarRating = min } } }, + new PlaylistItem { Beatmap = { Value = new BeatmapInfo { StarRating = max } } }, }); }); } diff --git a/osu.Game.Tests/Visual/SongSelect/TestSceneAdvancedStats.cs b/osu.Game.Tests/Visual/SongSelect/TestSceneAdvancedStats.cs index 07e68ef509..d57b3dec5d 100644 --- a/osu.Game.Tests/Visual/SongSelect/TestSceneAdvancedStats.cs +++ b/osu.Game.Tests/Visual/SongSelect/TestSceneAdvancedStats.cs @@ -46,7 +46,7 @@ namespace osu.Game.Tests.Visual.SongSelect OverallDifficulty = 5.7f, ApproachRate = 3.5f }, - StarDifficulty = 4.5f + StarRating = 4.5f }; [Test] @@ -76,7 +76,7 @@ namespace osu.Game.Tests.Visual.SongSelect OverallDifficulty = 4.5f, ApproachRate = 3.1f }, - StarDifficulty = 8 + StarRating = 8 }); AddAssert("first bar text is Key Count", () => advancedStats.ChildrenOfType().First().Text == "Key Count"); diff --git a/osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapCarousel.cs b/osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapCarousel.cs index 9a142f3ca8..3a5af6811d 100644 --- a/osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapCarousel.cs +++ b/osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapCarousel.cs @@ -435,8 +435,8 @@ namespace osu.Game.Tests.Visual.SongSelect for (int i = 0; i < 3; i++) { var set = createTestBeatmapSet(i); - set.Beatmaps[0].StarDifficulty = 3 - i; - set.Beatmaps[2].StarDifficulty = 6 + i; + set.Beatmaps[0].StarRating = 3 - i; + set.Beatmaps[2].StarRating = 6 + i; sets.Add(set); } @@ -686,7 +686,7 @@ namespace osu.Game.Tests.Visual.SongSelect { Version = $"Stars: {i}", Ruleset = new OsuRuleset().RulesetInfo, - StarDifficulty = i, + StarRating = i, }); } @@ -869,7 +869,7 @@ namespace osu.Game.Tests.Visual.SongSelect { OnlineBeatmapID = id++ * 10, Version = version, - StarDifficulty = diff, + StarRating = diff, Ruleset = new OsuRuleset().RulesetInfo, BaseDifficulty = new BeatmapDifficulty { @@ -904,7 +904,7 @@ namespace osu.Game.Tests.Visual.SongSelect Path = $"extra{b}.osu", Version = $"Extra {b}", Ruleset = rulesets.GetRuleset((b - 1) % 4), - StarDifficulty = 2, + StarRating = 2, BaseDifficulty = new BeatmapDifficulty { OverallDifficulty = 3.5f, diff --git a/osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapInfoWedge.cs b/osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapInfoWedge.cs index 9fa0eab548..666969eb2a 100644 --- a/osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapInfoWedge.cs +++ b/osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapInfoWedge.cs @@ -198,7 +198,7 @@ namespace osu.Game.Tests.Visual.SongSelect Title = $"{ruleset.ShortName}Title" }, Ruleset = ruleset, - StarDifficulty = 6, + StarRating = 6, Version = $"{ruleset.ShortName}Version", BaseDifficulty = new BeatmapDifficulty() }, diff --git a/osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapMetadataDisplay.cs b/osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapMetadataDisplay.cs index 50ae673c06..574ccce6d5 100644 --- a/osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapMetadataDisplay.cs +++ b/osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapMetadataDisplay.cs @@ -46,7 +46,7 @@ namespace osu.Game.Tests.Visual.SongSelect Title = title, }, Version = version, - StarDifficulty = RNG.NextDouble(0, 10), + StarRating = RNG.NextDouble(0, 10), } })); } @@ -65,7 +65,7 @@ namespace osu.Game.Tests.Visual.SongSelect Title = "Heavy beatmap", }, Version = "10k objects", - StarDifficulty = 99.99f, + StarRating = 99.99f, } })); diff --git a/osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapRecommendations.cs b/osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapRecommendations.cs index 68d5836cac..2c41ea1f53 100644 --- a/osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapRecommendations.cs +++ b/osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapRecommendations.cs @@ -188,7 +188,7 @@ namespace osu.Game.Tests.Visual.SongSelect Metadata = metadata, BaseDifficulty = new BeatmapDifficulty(), Ruleset = ruleset, - StarDifficulty = difficultyIndex + 1, + StarRating = difficultyIndex + 1, Version = $"SR{difficultyIndex + 1}" }).ToList() }; diff --git a/osu.Game/Beatmaps/BeatmapInfo.cs b/osu.Game/Beatmaps/BeatmapInfo.cs index 01a819dead..613b0599a0 100644 --- a/osu.Game/Beatmaps/BeatmapInfo.cs +++ b/osu.Game/Beatmaps/BeatmapInfo.cs @@ -139,7 +139,8 @@ namespace osu.Game.Beatmaps private string versionString => string.IsNullOrEmpty(Version) ? string.Empty : $"[{Version}]"; [JsonProperty("difficulty_rating")] - public double StarDifficulty { get; set; } + [Column("StarDifficulty")] + public double StarRating { get; set; } /// /// Currently only populated for beatmap deletion. Use to query scores. @@ -147,7 +148,7 @@ namespace osu.Game.Beatmaps public List Scores { get; set; } [JsonIgnore] - public DifficultyRating DifficultyRating => BeatmapDifficultyCache.GetDifficultyRating(StarDifficulty); + public DifficultyRating DifficultyRating => BeatmapDifficultyCache.GetDifficultyRating(StarRating); public override string ToString() => this.GetDisplayTitle(); @@ -197,9 +198,6 @@ namespace osu.Game.Beatmaps [JsonIgnore] IRulesetInfo IBeatmapInfo.Ruleset => Ruleset; - [JsonIgnore] - double IBeatmapInfo.StarRating => StarDifficulty; - #endregion } } diff --git a/osu.Game/Beatmaps/BeatmapModelManager.cs b/osu.Game/Beatmaps/BeatmapModelManager.cs index a654b05edb..d166f42cde 100644 --- a/osu.Game/Beatmaps/BeatmapModelManager.cs +++ b/osu.Game/Beatmaps/BeatmapModelManager.cs @@ -407,7 +407,7 @@ namespace osu.Game.Beatmaps beatmap.BeatmapInfo.Ruleset = ruleset; // TODO: this should be done in a better place once we actually need to dynamically update it. - beatmap.BeatmapInfo.StarDifficulty = ruleset?.CreateInstance().CreateDifficultyCalculator(new DummyConversionBeatmap(beatmap)).Calculate().StarRating ?? 0; + beatmap.BeatmapInfo.StarRating = ruleset?.CreateInstance().CreateDifficultyCalculator(new DummyConversionBeatmap(beatmap)).Calculate().StarRating ?? 0; beatmap.BeatmapInfo.Length = calculateLength(beatmap); beatmap.BeatmapInfo.BPM = 60000 / beatmap.GetMostCommonBeatLength(); diff --git a/osu.Game/Beatmaps/BeatmapSetInfo.cs b/osu.Game/Beatmaps/BeatmapSetInfo.cs index 638366c580..0c93c4b9db 100644 --- a/osu.Game/Beatmaps/BeatmapSetInfo.cs +++ b/osu.Game/Beatmaps/BeatmapSetInfo.cs @@ -38,7 +38,7 @@ namespace osu.Game.Beatmaps /// /// The maximum star difficulty of all beatmaps in this set. /// - public double MaxStarDifficulty => Beatmaps?.Max(b => b.StarDifficulty) ?? 0; + public double MaxStarDifficulty => Beatmaps?.Max(b => b.StarRating) ?? 0; /// /// The maximum playable length in milliseconds of all beatmaps in this set. diff --git a/osu.Game/Beatmaps/DifficultyRecommender.cs b/osu.Game/Beatmaps/DifficultyRecommender.cs index 86f5e0dabf..a2bd7c6ce9 100644 --- a/osu.Game/Beatmaps/DifficultyRecommender.cs +++ b/osu.Game/Beatmaps/DifficultyRecommender.cs @@ -64,7 +64,7 @@ namespace osu.Game.Beatmaps BeatmapInfo beatmapInfo = beatmaps.Where(b => b.Ruleset.Equals(r)).OrderBy(b => { - double difference = b.StarDifficulty - recommendation; + double difference = b.StarRating - recommendation; return difference >= 0 ? difference * 2 : difference * -1; // prefer easier over harder }).FirstOrDefault(); diff --git a/osu.Game/Screens/Edit/Editor.cs b/osu.Game/Screens/Edit/Editor.cs index de265ad94b..0ca7038580 100644 --- a/osu.Game/Screens/Edit/Editor.cs +++ b/osu.Game/Screens/Edit/Editor.cs @@ -723,7 +723,7 @@ namespace osu.Game.Screens.Edit if (difficultyItems.Count > 0) difficultyItems.Add(new EditorMenuItemSpacer()); - foreach (var beatmap in rulesetBeatmaps.OrderBy(b => b.StarDifficulty)) + foreach (var beatmap in rulesetBeatmaps.OrderBy(b => b.StarRating)) difficultyItems.Add(createDifficultyMenuItem(beatmap)); } diff --git a/osu.Game/Screens/Select/Carousel/CarouselBeatmap.cs b/osu.Game/Screens/Select/Carousel/CarouselBeatmap.cs index fa96e6dde7..1334784613 100644 --- a/osu.Game/Screens/Select/Carousel/CarouselBeatmap.cs +++ b/osu.Game/Screens/Select/Carousel/CarouselBeatmap.cs @@ -38,7 +38,7 @@ namespace osu.Game.Screens.Select.Carousel return; } - match &= !criteria.StarDifficulty.HasFilter || criteria.StarDifficulty.IsInRange(BeatmapInfo.StarDifficulty); + match &= !criteria.StarDifficulty.HasFilter || criteria.StarDifficulty.IsInRange(BeatmapInfo.StarRating); match &= !criteria.ApproachRate.HasFilter || criteria.ApproachRate.IsInRange(BeatmapInfo.BaseDifficulty.ApproachRate); match &= !criteria.DrainRate.HasFilter || criteria.DrainRate.IsInRange(BeatmapInfo.BaseDifficulty.DrainRate); match &= !criteria.CircleSize.HasFilter || criteria.CircleSize.IsInRange(BeatmapInfo.BaseDifficulty.CircleSize); @@ -53,7 +53,7 @@ namespace osu.Game.Screens.Select.Carousel match &= !criteria.Artist.HasFilter || criteria.Artist.Matches(BeatmapInfo.Metadata.Artist) || criteria.Artist.Matches(BeatmapInfo.Metadata.ArtistUnicode); - match &= !criteria.UserStarDifficulty.HasFilter || criteria.UserStarDifficulty.IsInRange(BeatmapInfo.StarDifficulty); + match &= !criteria.UserStarDifficulty.HasFilter || criteria.UserStarDifficulty.IsInRange(BeatmapInfo.StarRating); if (match) { @@ -92,7 +92,7 @@ namespace osu.Game.Screens.Select.Carousel int ruleset = BeatmapInfo.RulesetID.CompareTo(otherBeatmap.BeatmapInfo.RulesetID); if (ruleset != 0) return ruleset; - return BeatmapInfo.StarDifficulty.CompareTo(otherBeatmap.BeatmapInfo.StarDifficulty); + return BeatmapInfo.StarRating.CompareTo(otherBeatmap.BeatmapInfo.StarRating); } } diff --git a/osu.Game/Screens/Select/Carousel/CarouselBeatmapSet.cs b/osu.Game/Screens/Select/Carousel/CarouselBeatmapSet.cs index e465f423bc..9e411d5daa 100644 --- a/osu.Game/Screens/Select/Carousel/CarouselBeatmapSet.cs +++ b/osu.Game/Screens/Select/Carousel/CarouselBeatmapSet.cs @@ -84,7 +84,7 @@ namespace osu.Game.Screens.Select.Carousel return compareUsingAggregateMax(otherSet, b => b.Length); case SortMode.Difficulty: - return compareUsingAggregateMax(otherSet, b => b.StarDifficulty); + return compareUsingAggregateMax(otherSet, b => b.StarRating); } } diff --git a/osu.Game/Tests/Visual/OsuTestScene.cs b/osu.Game/Tests/Visual/OsuTestScene.cs index 83e1423504..55a3a6874e 100644 --- a/osu.Game/Tests/Visual/OsuTestScene.cs +++ b/osu.Game/Tests/Visual/OsuTestScene.cs @@ -228,7 +228,7 @@ namespace osu.Game.Tests.Visual Checksum = beatmap.MD5Hash, AuthorID = beatmap.Metadata.Author.OnlineID, RulesetID = beatmap.RulesetID, - StarRating = beatmap.StarDifficulty, + StarRating = beatmap.StarRating, DifficultyName = beatmap.Version, } }