Merge pull request #15572 from peppy/rename-ef-model-properties

Rename EF properties to match underlying interface
This commit is contained in:
Dan Balasescu 2021-11-11 21:07:30 +09:00 committed by GitHub
commit de4f7fa2f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
34 changed files with 67 additions and 73 deletions

View File

@ -51,7 +51,7 @@ namespace osu.Game.Rulesets.Taiko.Tests.Editor
editorBeatmap.BeatmapInfo.Metadata.Artist = "artist"; editorBeatmap.BeatmapInfo.Metadata.Artist = "artist";
editorBeatmap.BeatmapInfo.Metadata.Title = "title"; editorBeatmap.BeatmapInfo.Metadata.Title = "title";
}); });
AddStep("Set difficulty name", () => editorBeatmap.BeatmapInfo.Version = "difficulty"); AddStep("Set difficulty name", () => editorBeatmap.BeatmapInfo.DifficultyName = "difficulty");
checkMutations(); checkMutations();
@ -85,7 +85,7 @@ namespace osu.Game.Rulesets.Taiko.Tests.Editor
return Precision.AlmostEquals(taikoDifficulty.SliderMultiplier, 2); return Precision.AlmostEquals(taikoDifficulty.SliderMultiplier, 2);
}); });
AddAssert("Beatmap has correct metadata", () => editorBeatmap.BeatmapInfo.Metadata.Artist == "artist" && editorBeatmap.BeatmapInfo.Metadata.Title == "title"); AddAssert("Beatmap has correct metadata", () => editorBeatmap.BeatmapInfo.Metadata.Artist == "artist" && editorBeatmap.BeatmapInfo.Metadata.Title == "title");
AddAssert("Beatmap has correct difficulty name", () => editorBeatmap.BeatmapInfo.Version == "difficulty"); AddAssert("Beatmap has correct difficulty name", () => editorBeatmap.BeatmapInfo.DifficultyName == "difficulty");
} }
} }
} }

View File

@ -113,7 +113,7 @@ namespace osu.Game.Tests.Beatmaps.Formats
Assert.AreEqual("Soleily", metadata.Artist); Assert.AreEqual("Soleily", metadata.Artist);
Assert.AreEqual("Soleily", metadata.ArtistUnicode); Assert.AreEqual("Soleily", metadata.ArtistUnicode);
Assert.AreEqual("Gamu", metadata.Author.Username); Assert.AreEqual("Gamu", metadata.Author.Username);
Assert.AreEqual("Insane", beatmapInfo.Version); Assert.AreEqual("Insane", beatmapInfo.DifficultyName);
Assert.AreEqual(string.Empty, metadata.Source); Assert.AreEqual(string.Empty, metadata.Source);
Assert.AreEqual("MBC7 Unisphere 地球ヤバイEP Chikyu Yabai", metadata.Tags); Assert.AreEqual("MBC7 Unisphere 地球ヤバイEP Chikyu Yabai", metadata.Tags);
Assert.AreEqual(557821, beatmapInfo.OnlineBeatmapID); Assert.AreEqual(557821, beatmapInfo.OnlineBeatmapID);

View File

@ -790,12 +790,12 @@ namespace osu.Game.Tests.Beatmaps.IO
// Update via the beatmap, not the beatmap info, to ensure correct linking // Update via the beatmap, not the beatmap info, to ensure correct linking
BeatmapSetInfo setToUpdate = manager.GetAllUsableBeatmapSets()[0]; BeatmapSetInfo setToUpdate = manager.GetAllUsableBeatmapSets()[0];
Beatmap beatmapToUpdate = (Beatmap)manager.GetWorkingBeatmap(setToUpdate.Beatmaps.First(b => b.RulesetID == 0)).Beatmap; Beatmap beatmapToUpdate = (Beatmap)manager.GetWorkingBeatmap(setToUpdate.Beatmaps.First(b => b.RulesetID == 0)).Beatmap;
beatmapToUpdate.BeatmapInfo.Version = "updated"; beatmapToUpdate.BeatmapInfo.DifficultyName = "updated";
manager.Update(setToUpdate); manager.Update(setToUpdate);
BeatmapInfo updatedInfo = manager.QueryBeatmap(b => b.ID == beatmapToUpdate.BeatmapInfo.ID); BeatmapInfo updatedInfo = manager.QueryBeatmap(b => b.ID == beatmapToUpdate.BeatmapInfo.ID);
Assert.That(updatedInfo.Version, Is.EqualTo("updated")); Assert.That(updatedInfo.DifficultyName, Is.EqualTo("updated"));
} }
finally finally
{ {
@ -863,7 +863,7 @@ namespace osu.Game.Tests.Beatmaps.IO
var beatmap = working.Beatmap; var beatmap = working.Beatmap;
beatmap.BeatmapInfo.Version = "difficulty"; beatmap.BeatmapInfo.DifficultyName = "difficulty";
beatmap.BeatmapInfo.Metadata = new BeatmapMetadata beatmap.BeatmapInfo.Metadata = new BeatmapMetadata
{ {
Artist = "Artist/With\\Slashes", Artist = "Artist/With\\Slashes",

View File

@ -52,7 +52,7 @@ namespace osu.Game.Tests.Beatmaps
Title = "title", Title = "title",
Author = new APIUser { Username = "creator" } Author = new APIUser { Username = "creator" }
}, },
Version = "difficulty" DifficultyName = "difficulty"
}; };
Assert.That(beatmap.ToString(), Is.EqualTo("artist - title (creator) [difficulty]")); Assert.That(beatmap.ToString(), Is.EqualTo("artist - title (creator) [difficulty]"));

View File

@ -17,7 +17,7 @@ namespace osu.Game.Tests.NonVisual.Filtering
private BeatmapInfo getExampleBeatmap() => new BeatmapInfo private BeatmapInfo getExampleBeatmap() => new BeatmapInfo
{ {
Ruleset = new RulesetInfo { ID = 5 }, Ruleset = new RulesetInfo { ID = 5 },
StarDifficulty = 4.0d, StarRating = 4.0d,
BaseDifficulty = new BeatmapDifficulty BaseDifficulty = new BeatmapDifficulty
{ {
ApproachRate = 5.0f, ApproachRate = 5.0f,
@ -34,7 +34,7 @@ namespace osu.Game.Tests.NonVisual.Filtering
Source = "unit tests", Source = "unit tests",
Tags = "look for tags too", Tags = "look for tags too",
}, },
Version = "version as well", DifficultyName = "version as well",
Length = 2500, Length = 2500,
BPM = 160, BPM = 160,
BeatDivisor = 12, BeatDivisor = 12,

View File

@ -46,7 +46,7 @@ namespace osu.Game.Tests.Visual.Editing
editorBeatmap.BeatmapInfo.Metadata.Artist = "artist"; editorBeatmap.BeatmapInfo.Metadata.Artist = "artist";
editorBeatmap.BeatmapInfo.Metadata.Title = "title"; editorBeatmap.BeatmapInfo.Metadata.Title = "title";
}); });
AddStep("Set difficulty name", () => editorBeatmap.BeatmapInfo.Version = "difficulty"); AddStep("Set difficulty name", () => editorBeatmap.BeatmapInfo.DifficultyName = "difficulty");
AddStep("Add timing point", () => editorBeatmap.ControlPointInfo.Add(0, new TimingControlPoint())); AddStep("Add timing point", () => editorBeatmap.ControlPointInfo.Add(0, new TimingControlPoint()));
@ -85,7 +85,7 @@ namespace osu.Game.Tests.Visual.Editing
AddAssert("Beatmap contains single hitcircle", () => editorBeatmap.HitObjects.Count == 1); AddAssert("Beatmap contains single hitcircle", () => editorBeatmap.HitObjects.Count == 1);
AddAssert("Beatmap has correct overall difficulty", () => editorBeatmap.Difficulty.OverallDifficulty == 7); AddAssert("Beatmap has correct overall difficulty", () => editorBeatmap.Difficulty.OverallDifficulty == 7);
AddAssert("Beatmap has correct metadata", () => editorBeatmap.BeatmapInfo.Metadata.Artist == "artist" && editorBeatmap.BeatmapInfo.Metadata.Title == "title"); AddAssert("Beatmap has correct metadata", () => editorBeatmap.BeatmapInfo.Metadata.Artist == "artist" && editorBeatmap.BeatmapInfo.Metadata.Title == "title");
AddAssert("Beatmap has correct difficulty name", () => editorBeatmap.BeatmapInfo.Version == "difficulty"); AddAssert("Beatmap has correct difficulty name", () => editorBeatmap.BeatmapInfo.DifficultyName == "difficulty");
} }
} }
} }

View File

@ -59,7 +59,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
{ {
BeatmapInfo = BeatmapInfo =
{ {
StarDifficulty = 2.5 StarRating = 2.5
} }
}.BeatmapInfo, }.BeatmapInfo,
} }
@ -82,7 +82,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
{ {
BeatmapInfo = BeatmapInfo =
{ {
StarDifficulty = 2.5, StarRating = 2.5,
Metadata = Metadata =
{ {
Artist = "very very very very very very very very very long artist", Artist = "very very very very very very very very very long artist",
@ -111,7 +111,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
{ {
BeatmapInfo = BeatmapInfo =
{ {
StarDifficulty = 2.5 StarRating = 2.5
} }
}.BeatmapInfo, }.BeatmapInfo,
} }
@ -124,7 +124,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
{ {
BeatmapInfo = BeatmapInfo =
{ {
StarDifficulty = 4.5 StarRating = 4.5
} }
}.BeatmapInfo, }.BeatmapInfo,
} }

View File

@ -55,7 +55,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
{ {
Ruleset = new OsuRuleset().RulesetInfo, Ruleset = new OsuRuleset().RulesetInfo,
OnlineBeatmapID = beatmapId, OnlineBeatmapID = beatmapId,
Version = $"{beatmapId} (length {TimeSpan.FromMilliseconds(length):m\\:ss}, bpm {bpm:0.#})", DifficultyName = $"{beatmapId} (length {TimeSpan.FromMilliseconds(length):m\\:ss}, bpm {bpm:0.#})",
Length = length, Length = length,
BPM = bpm, BPM = bpm,
BaseDifficulty = new BeatmapDifficulty BaseDifficulty = new BeatmapDifficulty

View File

@ -31,8 +31,8 @@ namespace osu.Game.Tests.Visual.Multiplayer
{ {
SelectedRoom.Value.Playlist.AddRange(new[] SelectedRoom.Value.Playlist.AddRange(new[]
{ {
new PlaylistItem { Beatmap = { Value = new BeatmapInfo { StarDifficulty = min } } }, new PlaylistItem { Beatmap = { Value = new BeatmapInfo { StarRating = min } } },
new PlaylistItem { Beatmap = { Value = new BeatmapInfo { StarDifficulty = max } } }, new PlaylistItem { Beatmap = { Value = new BeatmapInfo { StarRating = max } } },
}); });
}); });
} }

View File

@ -46,7 +46,7 @@ namespace osu.Game.Tests.Visual.SongSelect
OverallDifficulty = 5.7f, OverallDifficulty = 5.7f,
ApproachRate = 3.5f ApproachRate = 3.5f
}, },
StarDifficulty = 4.5f StarRating = 4.5f
}; };
[Test] [Test]
@ -76,7 +76,7 @@ namespace osu.Game.Tests.Visual.SongSelect
OverallDifficulty = 4.5f, OverallDifficulty = 4.5f,
ApproachRate = 3.1f ApproachRate = 3.1f
}, },
StarDifficulty = 8 StarRating = 8
}); });
AddAssert("first bar text is Key Count", () => advancedStats.ChildrenOfType<SpriteText>().First().Text == "Key Count"); AddAssert("first bar text is Key Count", () => advancedStats.ChildrenOfType<SpriteText>().First().Text == "Key Count");

View File

@ -435,8 +435,8 @@ namespace osu.Game.Tests.Visual.SongSelect
for (int i = 0; i < 3; i++) for (int i = 0; i < 3; i++)
{ {
var set = createTestBeatmapSet(i); var set = createTestBeatmapSet(i);
set.Beatmaps[0].StarDifficulty = 3 - i; set.Beatmaps[0].StarRating = 3 - i;
set.Beatmaps[2].StarDifficulty = 6 + i; set.Beatmaps[2].StarRating = 6 + i;
sets.Add(set); sets.Add(set);
} }
@ -684,9 +684,9 @@ namespace osu.Game.Tests.Visual.SongSelect
{ {
set.Beatmaps.Add(new BeatmapInfo set.Beatmaps.Add(new BeatmapInfo
{ {
Version = $"Stars: {i}", DifficultyName = $"Stars: {i}",
Ruleset = new OsuRuleset().RulesetInfo, Ruleset = new OsuRuleset().RulesetInfo,
StarDifficulty = i, StarRating = i,
}); });
} }
@ -868,8 +868,8 @@ namespace osu.Game.Tests.Visual.SongSelect
yield return new BeatmapInfo yield return new BeatmapInfo
{ {
OnlineBeatmapID = id++ * 10, OnlineBeatmapID = id++ * 10,
Version = version, DifficultyName = version,
StarDifficulty = diff, StarRating = diff,
Ruleset = new OsuRuleset().RulesetInfo, Ruleset = new OsuRuleset().RulesetInfo,
BaseDifficulty = new BeatmapDifficulty BaseDifficulty = new BeatmapDifficulty
{ {
@ -902,9 +902,9 @@ namespace osu.Game.Tests.Visual.SongSelect
{ {
OnlineBeatmapID = b * 10, OnlineBeatmapID = b * 10,
Path = $"extra{b}.osu", Path = $"extra{b}.osu",
Version = $"Extra {b}", DifficultyName = $"Extra {b}",
Ruleset = rulesets.GetRuleset((b - 1) % 4), Ruleset = rulesets.GetRuleset((b - 1) % 4),
StarDifficulty = 2, StarRating = 2,
BaseDifficulty = new BeatmapDifficulty BaseDifficulty = new BeatmapDifficulty
{ {
OverallDifficulty = 3.5f, OverallDifficulty = 3.5f,

View File

@ -198,8 +198,8 @@ namespace osu.Game.Tests.Visual.SongSelect
Title = $"{ruleset.ShortName}Title" Title = $"{ruleset.ShortName}Title"
}, },
Ruleset = ruleset, Ruleset = ruleset,
StarDifficulty = 6, StarRating = 6,
Version = $"{ruleset.ShortName}Version", DifficultyName = $"{ruleset.ShortName}Version",
BaseDifficulty = new BeatmapDifficulty() BaseDifficulty = new BeatmapDifficulty()
}, },
HitObjects = objects HitObjects = objects
@ -219,7 +219,7 @@ namespace osu.Game.Tests.Visual.SongSelect
Source = "Verrrrry long Source", Source = "Verrrrry long Source",
Title = "Verrrrry long Title" Title = "Verrrrry long Title"
}, },
Version = "Verrrrrrrrrrrrrrrrrrrrrrrrrrrrry long Version", DifficultyName = "Verrrrrrrrrrrrrrrrrrrrrrrrrrrrry long Version",
Status = BeatmapSetOnlineStatus.Graveyard, Status = BeatmapSetOnlineStatus.Graveyard,
}, },
}; };

View File

@ -45,8 +45,8 @@ namespace osu.Game.Tests.Visual.SongSelect
{ {
Title = title, Title = title,
}, },
Version = version, DifficultyName = version,
StarDifficulty = RNG.NextDouble(0, 10), StarRating = RNG.NextDouble(0, 10),
} }
})); }));
} }
@ -64,8 +64,8 @@ namespace osu.Game.Tests.Visual.SongSelect
{ {
Title = "Heavy beatmap", Title = "Heavy beatmap",
}, },
Version = "10k objects", DifficultyName = "10k objects",
StarDifficulty = 99.99f, StarRating = 99.99f,
} }
})); }));

View File

@ -188,8 +188,8 @@ namespace osu.Game.Tests.Visual.SongSelect
Metadata = metadata, Metadata = metadata,
BaseDifficulty = new BeatmapDifficulty(), BaseDifficulty = new BeatmapDifficulty(),
Ruleset = ruleset, Ruleset = ruleset,
StarDifficulty = difficultyIndex + 1, StarRating = difficultyIndex + 1,
Version = $"SR{difficultyIndex + 1}" DifficultyName = $"SR{difficultyIndex + 1}"
}).ToList() }).ToList()
}; };

View File

@ -919,7 +919,7 @@ namespace osu.Game.Tests.Visual.SongSelect
{ {
Ruleset = getRuleset(), Ruleset = getRuleset(),
OnlineBeatmapID = beatmapId, OnlineBeatmapID = beatmapId,
Version = $"{beatmapId} (length {TimeSpan.FromMilliseconds(length):m\\:ss}, bpm {bpm:0.#})", DifficultyName = $"{beatmapId} (length {TimeSpan.FromMilliseconds(length):m\\:ss}, bpm {bpm:0.#})",
Length = length, Length = length,
BPM = bpm, BPM = bpm,
BaseDifficulty = new BeatmapDifficulty BaseDifficulty = new BeatmapDifficulty

View File

@ -69,7 +69,7 @@ namespace osu.Game.Tests.Visual.UserInterface
Username = "TestAuthor" Username = "TestAuthor"
}, },
}, },
Version = "Insane" DifficultyName = "Insane"
}, },
} }
}, },

View File

@ -56,7 +56,7 @@ namespace osu.Game.Beatmaps
Title = @"Unknown", Title = @"Unknown",
AuthorString = @"Unknown Creator", AuthorString = @"Unknown Creator",
}, },
Version = @"Normal", DifficultyName = @"Normal",
BaseDifficulty = Difficulty, BaseDifficulty = Difficulty,
}; };
} }

View File

@ -134,12 +134,12 @@ namespace osu.Game.Beatmaps
public double TimelineZoom { get; set; } public double TimelineZoom { get; set; }
// Metadata // Metadata
public string Version { get; set; } [Column("Version")]
public string DifficultyName { get; set; }
private string versionString => string.IsNullOrEmpty(Version) ? string.Empty : $"[{Version}]";
[JsonProperty("difficulty_rating")] [JsonProperty("difficulty_rating")]
public double StarDifficulty { get; set; } [Column("StarDifficulty")]
public double StarRating { get; set; }
/// <summary> /// <summary>
/// Currently only populated for beatmap deletion. Use <see cref="ScoreManager"/> to query scores. /// Currently only populated for beatmap deletion. Use <see cref="ScoreManager"/> to query scores.
@ -147,7 +147,7 @@ namespace osu.Game.Beatmaps
public List<ScoreInfo> Scores { get; set; } public List<ScoreInfo> Scores { get; set; }
[JsonIgnore] [JsonIgnore]
public DifficultyRating DifficultyRating => BeatmapDifficultyCache.GetDifficultyRating(StarDifficulty); public DifficultyRating DifficultyRating => BeatmapDifficultyCache.GetDifficultyRating(StarRating);
public override string ToString() => this.GetDisplayTitle(); public override string ToString() => this.GetDisplayTitle();
@ -182,9 +182,6 @@ namespace osu.Game.Beatmaps
#region Implementation of IBeatmapInfo #region Implementation of IBeatmapInfo
[JsonIgnore]
string IBeatmapInfo.DifficultyName => Version;
[JsonIgnore] [JsonIgnore]
IBeatmapMetadataInfo IBeatmapInfo.Metadata => Metadata ?? BeatmapSet?.Metadata ?? new BeatmapMetadata(); IBeatmapMetadataInfo IBeatmapInfo.Metadata => Metadata ?? BeatmapSet?.Metadata ?? new BeatmapMetadata();
@ -197,9 +194,6 @@ namespace osu.Game.Beatmaps
[JsonIgnore] [JsonIgnore]
IRulesetInfo IBeatmapInfo.Ruleset => Ruleset; IRulesetInfo IBeatmapInfo.Ruleset => Ruleset;
[JsonIgnore]
double IBeatmapInfo.StarRating => StarDifficulty;
#endregion #endregion
} }
} }

View File

@ -215,7 +215,7 @@ namespace osu.Game.Beatmaps
var fileInfo = setInfo.Files.SingleOrDefault(f => string.Equals(f.Filename, beatmapInfo.Path, StringComparison.OrdinalIgnoreCase)) ?? new BeatmapSetFileInfo(); var fileInfo = setInfo.Files.SingleOrDefault(f => string.Equals(f.Filename, beatmapInfo.Path, StringComparison.OrdinalIgnoreCase)) ?? new BeatmapSetFileInfo();
// metadata may have changed; update the path with the standard format. // metadata may have changed; update the path with the standard format.
beatmapInfo.Path = GetValidFilename($"{metadata.Artist} - {metadata.Title} ({metadata.Author}) [{beatmapInfo.Version}].osu"); beatmapInfo.Path = GetValidFilename($"{metadata.Artist} - {metadata.Title} ({metadata.Author}) [{beatmapInfo.DifficultyName}].osu");
beatmapInfo.MD5Hash = stream.ComputeMD5Hash(); beatmapInfo.MD5Hash = stream.ComputeMD5Hash();
@ -407,7 +407,7 @@ namespace osu.Game.Beatmaps
beatmap.BeatmapInfo.Ruleset = ruleset; beatmap.BeatmapInfo.Ruleset = ruleset;
// TODO: this should be done in a better place once we actually need to dynamically update it. // 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.Length = calculateLength(beatmap);
beatmap.BeatmapInfo.BPM = 60000 / beatmap.GetMostCommonBeatLength(); beatmap.BeatmapInfo.BPM = 60000 / beatmap.GetMostCommonBeatLength();

View File

@ -38,7 +38,7 @@ namespace osu.Game.Beatmaps
/// <summary> /// <summary>
/// The maximum star difficulty of all beatmaps in this set. /// The maximum star difficulty of all beatmaps in this set.
/// </summary> /// </summary>
public double MaxStarDifficulty => Beatmaps?.Max(b => b.StarDifficulty) ?? 0; public double MaxStarDifficulty => Beatmaps?.Max(b => b.StarRating) ?? 0;
/// <summary> /// <summary>
/// The maximum playable length in milliseconds of all beatmaps in this set. /// The maximum playable length in milliseconds of all beatmaps in this set.

View File

@ -64,7 +64,7 @@ namespace osu.Game.Beatmaps
BeatmapInfo beatmapInfo = beatmaps.Where(b => b.Ruleset.Equals(r)).OrderBy(b => 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 return difference >= 0 ? difference * 2 : difference * -1; // prefer easier over harder
}).FirstOrDefault(); }).FirstOrDefault();

View File

@ -251,7 +251,7 @@ namespace osu.Game.Beatmaps.Formats
break; break;
case @"Version": case @"Version":
beatmap.BeatmapInfo.Version = pair.Value; beatmap.BeatmapInfo.DifficultyName = pair.Value;
break; break;
case @"Source": case @"Source":

View File

@ -130,7 +130,7 @@ namespace osu.Game.Beatmaps.Formats
writer.WriteLine(FormattableString.Invariant($"Artist: {beatmap.Metadata.Artist}")); writer.WriteLine(FormattableString.Invariant($"Artist: {beatmap.Metadata.Artist}"));
if (!string.IsNullOrEmpty(beatmap.Metadata.ArtistUnicode)) writer.WriteLine(FormattableString.Invariant($"ArtistUnicode: {beatmap.Metadata.ArtistUnicode}")); if (!string.IsNullOrEmpty(beatmap.Metadata.ArtistUnicode)) writer.WriteLine(FormattableString.Invariant($"ArtistUnicode: {beatmap.Metadata.ArtistUnicode}"));
writer.WriteLine(FormattableString.Invariant($"Creator: {beatmap.Metadata.Author.Username}")); writer.WriteLine(FormattableString.Invariant($"Creator: {beatmap.Metadata.Author.Username}"));
writer.WriteLine(FormattableString.Invariant($"Version: {beatmap.BeatmapInfo.Version}")); writer.WriteLine(FormattableString.Invariant($"Version: {beatmap.BeatmapInfo.DifficultyName}"));
if (!string.IsNullOrEmpty(beatmap.Metadata.Source)) writer.WriteLine(FormattableString.Invariant($"Source: {beatmap.Metadata.Source}")); if (!string.IsNullOrEmpty(beatmap.Metadata.Source)) writer.WriteLine(FormattableString.Invariant($"Source: {beatmap.Metadata.Source}"));
if (!string.IsNullOrEmpty(beatmap.Metadata.Tags)) writer.WriteLine(FormattableString.Invariant($"Tags: {beatmap.Metadata.Tags}")); if (!string.IsNullOrEmpty(beatmap.Metadata.Tags)) writer.WriteLine(FormattableString.Invariant($"Tags: {beatmap.Metadata.Tags}"));
if (beatmap.BeatmapInfo.OnlineBeatmapID != null) writer.WriteLine(FormattableString.Invariant($"BeatmapID: {beatmap.BeatmapInfo.OnlineBeatmapID}")); if (beatmap.BeatmapInfo.OnlineBeatmapID != null) writer.WriteLine(FormattableString.Invariant($"BeatmapID: {beatmap.BeatmapInfo.OnlineBeatmapID}"));

View File

@ -13,7 +13,7 @@ namespace osu.Game.Screens.Edit.Components.Menus
public BeatmapInfo BeatmapInfo { get; } public BeatmapInfo BeatmapInfo { get; }
public DifficultyMenuItem(BeatmapInfo beatmapInfo, bool selected, Action<BeatmapInfo> difficultyChangeFunc) public DifficultyMenuItem(BeatmapInfo beatmapInfo, bool selected, Action<BeatmapInfo> difficultyChangeFunc)
: base(beatmapInfo.Version ?? "(unnamed)", null) : base(beatmapInfo.DifficultyName ?? "(unnamed)", null)
{ {
BeatmapInfo = beatmapInfo; BeatmapInfo = beatmapInfo;
State.Value = selected; State.Value = selected;

View File

@ -723,7 +723,7 @@ namespace osu.Game.Screens.Edit
if (difficultyItems.Count > 0) if (difficultyItems.Count > 0)
difficultyItems.Add(new EditorMenuItemSpacer()); 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)); difficultyItems.Add(createDifficultyMenuItem(beatmap));
} }

View File

@ -47,7 +47,7 @@ namespace osu.Game.Screens.Edit.Setup
Empty(), Empty(),
creatorTextBox = createTextBox<LabelledTextBox>("Creator", metadata.Author.Username), creatorTextBox = createTextBox<LabelledTextBox>("Creator", metadata.Author.Username),
difficultyTextBox = createTextBox<LabelledTextBox>("Difficulty Name", Beatmap.BeatmapInfo.Version), difficultyTextBox = createTextBox<LabelledTextBox>("Difficulty Name", Beatmap.BeatmapInfo.DifficultyName),
sourceTextBox = createTextBox<LabelledTextBox>("Source", metadata.Source), sourceTextBox = createTextBox<LabelledTextBox>("Source", metadata.Source),
tagsTextBox = createTextBox<LabelledTextBox>("Tags", metadata.Tags) tagsTextBox = createTextBox<LabelledTextBox>("Tags", metadata.Tags)
}; };
@ -111,7 +111,7 @@ namespace osu.Game.Screens.Edit.Setup
Beatmap.Metadata.Title = RomanisedTitleTextBox.Current.Value; Beatmap.Metadata.Title = RomanisedTitleTextBox.Current.Value;
Beatmap.Metadata.AuthorString = creatorTextBox.Current.Value; Beatmap.Metadata.AuthorString = creatorTextBox.Current.Value;
Beatmap.BeatmapInfo.Version = difficultyTextBox.Current.Value; Beatmap.BeatmapInfo.DifficultyName = difficultyTextBox.Current.Value;
Beatmap.Metadata.Source = sourceTextBox.Current.Value; Beatmap.Metadata.Source = sourceTextBox.Current.Value;
Beatmap.Metadata.Tags = tagsTextBox.Current.Value; Beatmap.Metadata.Tags = tagsTextBox.Current.Value;
} }

View File

@ -126,7 +126,7 @@ namespace osu.Game.Screens.Play
{ {
new OsuSpriteText new OsuSpriteText
{ {
Text = beatmap?.BeatmapInfo?.Version, Text = beatmap?.BeatmapInfo?.DifficultyName,
Font = OsuFont.GetFont(size: 26, italics: true), Font = OsuFont.GetFont(size: 26, italics: true),
Anchor = Anchor.TopCentre, Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre, Origin = Anchor.TopCentre,

View File

@ -164,7 +164,7 @@ namespace osu.Game.Screens.Ranking.Expanded
{ {
Anchor = Anchor.TopCentre, Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre, Origin = Anchor.TopCentre,
Text = beatmap.Version, Text = beatmap.DifficultyName,
Font = OsuFont.Torus.With(size: 16, weight: FontWeight.SemiBold), Font = OsuFont.Torus.With(size: 16, weight: FontWeight.SemiBold),
}, },
new OsuTextFlowContainer(s => s.Font = OsuFont.Torus.With(size: 12)) new OsuTextFlowContainer(s => s.Font = OsuFont.Torus.With(size: 12))

View File

@ -229,7 +229,7 @@ namespace osu.Game.Screens.Select
{ {
VersionLabel = new OsuSpriteText VersionLabel = new OsuSpriteText
{ {
Text = beatmapInfo.Version, Text = beatmapInfo.DifficultyName,
Font = OsuFont.GetFont(size: 24, italics: true), Font = OsuFont.GetFont(size: 24, italics: true),
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
Truncate = true, Truncate = true,
@ -324,7 +324,7 @@ namespace osu.Game.Screens.Select
}); });
// no difficulty means it can't have a status to show // no difficulty means it can't have a status to show
if (beatmapInfo.Version == null) if (beatmapInfo.DifficultyName == null)
StatusPill.Hide(); StatusPill.Hide();
addInfoLabels(); addInfoLabels();

View File

@ -38,7 +38,7 @@ namespace osu.Game.Screens.Select.Carousel
return; 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.ApproachRate.HasFilter || criteria.ApproachRate.IsInRange(BeatmapInfo.BaseDifficulty.ApproachRate);
match &= !criteria.DrainRate.HasFilter || criteria.DrainRate.IsInRange(BeatmapInfo.BaseDifficulty.DrainRate); match &= !criteria.DrainRate.HasFilter || criteria.DrainRate.IsInRange(BeatmapInfo.BaseDifficulty.DrainRate);
match &= !criteria.CircleSize.HasFilter || criteria.CircleSize.IsInRange(BeatmapInfo.BaseDifficulty.CircleSize); 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) || match &= !criteria.Artist.HasFilter || criteria.Artist.Matches(BeatmapInfo.Metadata.Artist) ||
criteria.Artist.Matches(BeatmapInfo.Metadata.ArtistUnicode); 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) if (match)
{ {
@ -92,7 +92,7 @@ namespace osu.Game.Screens.Select.Carousel
int ruleset = BeatmapInfo.RulesetID.CompareTo(otherBeatmap.BeatmapInfo.RulesetID); int ruleset = BeatmapInfo.RulesetID.CompareTo(otherBeatmap.BeatmapInfo.RulesetID);
if (ruleset != 0) return ruleset; if (ruleset != 0) return ruleset;
return BeatmapInfo.StarDifficulty.CompareTo(otherBeatmap.BeatmapInfo.StarDifficulty); return BeatmapInfo.StarRating.CompareTo(otherBeatmap.BeatmapInfo.StarRating);
} }
} }

View File

@ -84,7 +84,7 @@ namespace osu.Game.Screens.Select.Carousel
return compareUsingAggregateMax(otherSet, b => b.Length); return compareUsingAggregateMax(otherSet, b => b.Length);
case SortMode.Difficulty: case SortMode.Difficulty:
return compareUsingAggregateMax(otherSet, b => b.StarDifficulty); return compareUsingAggregateMax(otherSet, b => b.StarRating);
} }
} }

View File

@ -129,7 +129,7 @@ namespace osu.Game.Screens.Select.Carousel
{ {
new OsuSpriteText new OsuSpriteText
{ {
Text = beatmapInfo.Version, Text = beatmapInfo.DifficultyName,
Font = OsuFont.GetFont(size: 20), Font = OsuFont.GetFont(size: 20),
Anchor = Anchor.BottomLeft, Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft Origin = Anchor.BottomLeft

View File

@ -253,7 +253,7 @@ namespace osu.Game.Stores
var beatmap = new RealmBeatmap(ruleset, difficulty, metadata) var beatmap = new RealmBeatmap(ruleset, difficulty, metadata)
{ {
Hash = hash, Hash = hash,
DifficultyName = decodedInfo.Version, DifficultyName = decodedInfo.DifficultyName,
OnlineID = decodedInfo.OnlineBeatmapID ?? -1, OnlineID = decodedInfo.OnlineBeatmapID ?? -1,
AudioLeadIn = decodedInfo.AudioLeadIn, AudioLeadIn = decodedInfo.AudioLeadIn,
StackLeniency = decodedInfo.StackLeniency, StackLeniency = decodedInfo.StackLeniency,

View File

@ -228,8 +228,8 @@ namespace osu.Game.Tests.Visual
Checksum = beatmap.MD5Hash, Checksum = beatmap.MD5Hash,
AuthorID = beatmap.Metadata.Author.OnlineID, AuthorID = beatmap.Metadata.Author.OnlineID,
RulesetID = beatmap.RulesetID, RulesetID = beatmap.RulesetID,
StarRating = beatmap.StarDifficulty, StarRating = beatmap.StarRating,
DifficultyName = beatmap.Version, DifficultyName = beatmap.DifficultyName,
} }
} }
}; };