Rename BeatmapInfo variables which were named beatmap for clarity

This commit is contained in:
Dean Herbert
2021-10-02 12:44:22 +09:00
parent 1be96b4292
commit 973c31132b
19 changed files with 140 additions and 140 deletions

View File

@ -286,7 +286,7 @@ namespace osu.Game.Tests.Visual.Background
private void setupUserSettings() private void setupUserSettings()
{ {
AddUntilStep("Song select is current", () => songSelect.IsCurrentScreen()); AddUntilStep("Song select is current", () => songSelect.IsCurrentScreen());
AddUntilStep("Song select has selection", () => songSelect.Carousel?.SelectedBeatmap != null); AddUntilStep("Song select has selection", () => songSelect.Carousel?.SelectedBeatmapInfo != null);
AddStep("Set default user settings", () => AddStep("Set default user settings", () =>
{ {
SelectedMods.Value = SelectedMods.Value.Concat(new[] { new OsuModNoFail() }).ToArray(); SelectedMods.Value = SelectedMods.Value.Concat(new[] { new OsuModNoFail() }).ToArray();

View File

@ -51,7 +51,7 @@ namespace osu.Game.Tests.Visual.SongSelect
[Test] [Test]
public void TestNoMod() public void TestNoMod()
{ {
AddStep("set beatmap", () => advancedStats.Beatmap = exampleBeatmapInfo); AddStep("set beatmap", () => advancedStats.BeatmapInfo = exampleBeatmapInfo);
AddStep("no mods selected", () => SelectedMods.Value = Array.Empty<Mod>()); AddStep("no mods selected", () => SelectedMods.Value = Array.Empty<Mod>());
@ -65,7 +65,7 @@ namespace osu.Game.Tests.Visual.SongSelect
[Test] [Test]
public void TestManiaFirstBarText() public void TestManiaFirstBarText()
{ {
AddStep("set beatmap", () => advancedStats.Beatmap = new BeatmapInfo AddStep("set beatmap", () => advancedStats.BeatmapInfo = new BeatmapInfo
{ {
Ruleset = rulesets.GetRuleset(3), Ruleset = rulesets.GetRuleset(3),
BaseDifficulty = new BeatmapDifficulty BaseDifficulty = new BeatmapDifficulty
@ -84,11 +84,11 @@ namespace osu.Game.Tests.Visual.SongSelect
[Test] [Test]
public void TestEasyMod() public void TestEasyMod()
{ {
AddStep("set beatmap", () => advancedStats.Beatmap = exampleBeatmapInfo); AddStep("set beatmap", () => advancedStats.BeatmapInfo = exampleBeatmapInfo);
AddStep("select EZ mod", () => AddStep("select EZ mod", () =>
{ {
var ruleset = advancedStats.Beatmap.Ruleset.CreateInstance(); var ruleset = advancedStats.BeatmapInfo.Ruleset.CreateInstance();
SelectedMods.Value = new[] { ruleset.CreateMod<ModEasy>() }; SelectedMods.Value = new[] { ruleset.CreateMod<ModEasy>() };
}); });
@ -101,11 +101,11 @@ namespace osu.Game.Tests.Visual.SongSelect
[Test] [Test]
public void TestHardRockMod() public void TestHardRockMod()
{ {
AddStep("set beatmap", () => advancedStats.Beatmap = exampleBeatmapInfo); AddStep("set beatmap", () => advancedStats.BeatmapInfo = exampleBeatmapInfo);
AddStep("select HR mod", () => AddStep("select HR mod", () =>
{ {
var ruleset = advancedStats.Beatmap.Ruleset.CreateInstance(); var ruleset = advancedStats.BeatmapInfo.Ruleset.CreateInstance();
SelectedMods.Value = new[] { ruleset.CreateMod<ModHardRock>() }; SelectedMods.Value = new[] { ruleset.CreateMod<ModHardRock>() };
}); });
@ -118,13 +118,13 @@ namespace osu.Game.Tests.Visual.SongSelect
[Test] [Test]
public void TestUnchangedDifficultyAdjustMod() public void TestUnchangedDifficultyAdjustMod()
{ {
AddStep("set beatmap", () => advancedStats.Beatmap = exampleBeatmapInfo); AddStep("set beatmap", () => advancedStats.BeatmapInfo = exampleBeatmapInfo);
AddStep("select unchanged Difficulty Adjust mod", () => AddStep("select unchanged Difficulty Adjust mod", () =>
{ {
var ruleset = advancedStats.Beatmap.Ruleset.CreateInstance(); var ruleset = advancedStats.BeatmapInfo.Ruleset.CreateInstance();
var difficultyAdjustMod = ruleset.CreateMod<ModDifficultyAdjust>(); var difficultyAdjustMod = ruleset.CreateMod<ModDifficultyAdjust>();
difficultyAdjustMod.ReadFromDifficulty(advancedStats.Beatmap.BaseDifficulty); difficultyAdjustMod.ReadFromDifficulty(advancedStats.BeatmapInfo.BaseDifficulty);
SelectedMods.Value = new[] { difficultyAdjustMod }; SelectedMods.Value = new[] { difficultyAdjustMod };
}); });
@ -137,13 +137,13 @@ namespace osu.Game.Tests.Visual.SongSelect
[Test] [Test]
public void TestChangedDifficultyAdjustMod() public void TestChangedDifficultyAdjustMod()
{ {
AddStep("set beatmap", () => advancedStats.Beatmap = exampleBeatmapInfo); AddStep("set beatmap", () => advancedStats.BeatmapInfo = exampleBeatmapInfo);
AddStep("select changed Difficulty Adjust mod", () => AddStep("select changed Difficulty Adjust mod", () =>
{ {
var ruleset = advancedStats.Beatmap.Ruleset.CreateInstance(); var ruleset = advancedStats.BeatmapInfo.Ruleset.CreateInstance();
var difficultyAdjustMod = ruleset.CreateMod<OsuModDifficultyAdjust>(); var difficultyAdjustMod = ruleset.CreateMod<OsuModDifficultyAdjust>();
var originalDifficulty = advancedStats.Beatmap.BaseDifficulty; var originalDifficulty = advancedStats.BeatmapInfo.BaseDifficulty;
difficultyAdjustMod.ReadFromDifficulty(originalDifficulty); difficultyAdjustMod.ReadFromDifficulty(originalDifficulty);
difficultyAdjustMod.DrainRate.Value = originalDifficulty.DrainRate - 0.5f; difficultyAdjustMod.DrainRate.Value = originalDifficulty.DrainRate - 0.5f;

View File

@ -31,7 +31,7 @@ namespace osu.Game.Tests.Visual.SongSelect
private readonly Stack<BeatmapSetInfo> selectedSets = new Stack<BeatmapSetInfo>(); private readonly Stack<BeatmapSetInfo> selectedSets = new Stack<BeatmapSetInfo>();
private readonly HashSet<int> eagerSelectedIDs = new HashSet<int>(); private readonly HashSet<int> eagerSelectedIDs = new HashSet<int>();
private BeatmapInfo currentSelection => carousel.SelectedBeatmap; private BeatmapInfo currentSelection => carousel.SelectedBeatmapInfo;
private const int set_count = 5; private const int set_count = 5;
@ -75,11 +75,11 @@ namespace osu.Game.Tests.Visual.SongSelect
{ {
for (int i = 0; i < 3; i++) for (int i = 0; i < 3; i++)
{ {
AddStep("store selection", () => selection = carousel.SelectedBeatmap); AddStep("store selection", () => selection = carousel.SelectedBeatmapInfo);
if (isIterating) if (isIterating)
AddUntilStep("selection changed", () => carousel.SelectedBeatmap != selection); AddUntilStep("selection changed", () => carousel.SelectedBeatmapInfo != selection);
else else
AddUntilStep("selection not changed", () => carousel.SelectedBeatmap == selection); AddUntilStep("selection not changed", () => carousel.SelectedBeatmapInfo == selection);
} }
} }
} }
@ -387,7 +387,7 @@ namespace osu.Game.Tests.Visual.SongSelect
AddStep("Set non-empty mode filter", () => AddStep("Set non-empty mode filter", () =>
carousel.Filter(new FilterCriteria { Ruleset = rulesets.AvailableRulesets.ElementAt(1) }, false)); carousel.Filter(new FilterCriteria { Ruleset = rulesets.AvailableRulesets.ElementAt(1) }, false));
AddAssert("Something is selected", () => carousel.SelectedBeatmap != null); AddAssert("Something is selected", () => carousel.SelectedBeatmapInfo != null);
} }
/// <summary> /// <summary>
@ -562,7 +562,7 @@ namespace osu.Game.Tests.Visual.SongSelect
AddStep("filter to ruleset 0", () => AddStep("filter to ruleset 0", () =>
carousel.Filter(new FilterCriteria { Ruleset = rulesets.AvailableRulesets.ElementAt(0) }, false)); carousel.Filter(new FilterCriteria { Ruleset = rulesets.AvailableRulesets.ElementAt(0) }, false));
AddStep("select filtered map skipping filtered", () => carousel.SelectBeatmap(testMixed.Beatmaps[1], false)); AddStep("select filtered map skipping filtered", () => carousel.SelectBeatmap(testMixed.Beatmaps[1], false));
AddAssert("unfiltered beatmap not selected", () => carousel.SelectedBeatmap.RulesetID == 0); AddAssert("unfiltered beatmap not selected", () => carousel.SelectedBeatmapInfo.RulesetID == 0);
AddStep("remove mixed set", () => AddStep("remove mixed set", () =>
{ {
@ -653,7 +653,7 @@ namespace osu.Game.Tests.Visual.SongSelect
carousel.Filter(new FilterCriteria { SearchText = Guid.NewGuid().ToString() }, false); carousel.Filter(new FilterCriteria { SearchText = Guid.NewGuid().ToString() }, false);
}); });
AddAssert("selection lost", () => carousel.SelectedBeatmap == null); AddAssert("selection lost", () => carousel.SelectedBeatmapInfo == null);
AddStep("Restore different ruleset filter", () => AddStep("Restore different ruleset filter", () =>
{ {
@ -661,7 +661,7 @@ namespace osu.Game.Tests.Visual.SongSelect
eagerSelectedIDs.Add(carousel.SelectedBeatmapSet.ID); eagerSelectedIDs.Add(carousel.SelectedBeatmapSet.ID);
}); });
AddAssert("selection changed", () => carousel.SelectedBeatmap != manySets.First().Beatmaps.First()); AddAssert("selection changed", () => carousel.SelectedBeatmapInfo != manySets.First().Beatmaps.First());
} }
AddAssert("Selection was random", () => eagerSelectedIDs.Count > 2); AddAssert("Selection was random", () => eagerSelectedIDs.Count > 2);
@ -763,9 +763,9 @@ namespace osu.Game.Tests.Visual.SongSelect
AddUntilStep($"selected is set{set}{(diff.HasValue ? $" diff{diff.Value}" : "")}", () => AddUntilStep($"selected is set{set}{(diff.HasValue ? $" diff{diff.Value}" : "")}", () =>
{ {
if (diff != null) if (diff != null)
return carousel.SelectedBeatmap == carousel.BeatmapSets.Skip(set - 1).First().Beatmaps.Skip(diff.Value - 1).First(); return carousel.SelectedBeatmapInfo == carousel.BeatmapSets.Skip(set - 1).First().Beatmaps.Skip(diff.Value - 1).First();
return carousel.BeatmapSets.Skip(set - 1).First().Beatmaps.Contains(carousel.SelectedBeatmap); return carousel.BeatmapSets.Skip(set - 1).First().Beatmaps.Contains(carousel.SelectedBeatmapInfo);
}); });
private void setSelected(int set, int diff) => private void setSelected(int set, int diff) =>
@ -800,7 +800,7 @@ namespace osu.Game.Tests.Visual.SongSelect
{ {
carousel.RandomAlgorithm.Value = RandomSelectAlgorithm.RandomPermutation; carousel.RandomAlgorithm.Value = RandomSelectAlgorithm.RandomPermutation;
if (!selectedSets.Any() && carousel.SelectedBeatmap != null) if (!selectedSets.Any() && carousel.SelectedBeatmapInfo != null)
selectedSets.Push(carousel.SelectedBeatmapSet); selectedSets.Push(carousel.SelectedBeatmapSet);
carousel.SelectNextRandom(); carousel.SelectNextRandom();

View File

@ -145,7 +145,7 @@ namespace osu.Game.Tests.Visual.SongSelect
AddStep("select next and enter", () => AddStep("select next and enter", () =>
{ {
InputManager.MoveMouseTo(songSelect.Carousel.ChildrenOfType<DrawableCarouselBeatmap>() InputManager.MoveMouseTo(songSelect.Carousel.ChildrenOfType<DrawableCarouselBeatmap>()
.First(b => ((CarouselBeatmap)b.Item).Beatmap != songSelect.Carousel.SelectedBeatmap)); .First(b => ((CarouselBeatmap)b.Item).BeatmapInfo != songSelect.Carousel.SelectedBeatmapInfo));
InputManager.Click(MouseButton.Left); InputManager.Click(MouseButton.Left);
@ -172,7 +172,7 @@ namespace osu.Game.Tests.Visual.SongSelect
AddStep("select next and enter", () => AddStep("select next and enter", () =>
{ {
InputManager.MoveMouseTo(songSelect.Carousel.ChildrenOfType<DrawableCarouselBeatmap>() InputManager.MoveMouseTo(songSelect.Carousel.ChildrenOfType<DrawableCarouselBeatmap>()
.First(b => ((CarouselBeatmap)b.Item).Beatmap != songSelect.Carousel.SelectedBeatmap)); .First(b => ((CarouselBeatmap)b.Item).BeatmapInfo != songSelect.Carousel.SelectedBeatmapInfo));
InputManager.PressButton(MouseButton.Left); InputManager.PressButton(MouseButton.Left);
@ -312,7 +312,7 @@ namespace osu.Game.Tests.Visual.SongSelect
{ {
createSongSelect(); createSongSelect();
addRulesetImportStep(2); addRulesetImportStep(2);
AddUntilStep("no selection", () => songSelect.Carousel.SelectedBeatmap == null); AddUntilStep("no selection", () => songSelect.Carousel.SelectedBeatmapInfo == null);
} }
[Test] [Test]
@ -322,13 +322,13 @@ namespace osu.Game.Tests.Visual.SongSelect
changeRuleset(2); changeRuleset(2);
addRulesetImportStep(2); addRulesetImportStep(2);
addRulesetImportStep(1); addRulesetImportStep(1);
AddUntilStep("has selection", () => songSelect.Carousel.SelectedBeatmap.RulesetID == 2); AddUntilStep("has selection", () => songSelect.Carousel.SelectedBeatmapInfo.RulesetID == 2);
changeRuleset(1); changeRuleset(1);
AddUntilStep("has selection", () => songSelect.Carousel.SelectedBeatmap.RulesetID == 1); AddUntilStep("has selection", () => songSelect.Carousel.SelectedBeatmapInfo.RulesetID == 1);
changeRuleset(0); changeRuleset(0);
AddUntilStep("no selection", () => songSelect.Carousel.SelectedBeatmap == null); AddUntilStep("no selection", () => songSelect.Carousel.SelectedBeatmapInfo == null);
} }
[Test] [Test]
@ -338,7 +338,7 @@ namespace osu.Game.Tests.Visual.SongSelect
changeRuleset(2); changeRuleset(2);
addRulesetImportStep(2); addRulesetImportStep(2);
AddUntilStep("has selection", () => songSelect.Carousel.SelectedBeatmap.RulesetID == 2); AddUntilStep("has selection", () => songSelect.Carousel.SelectedBeatmapInfo.RulesetID == 2);
addRulesetImportStep(0); addRulesetImportStep(0);
addRulesetImportStep(0); addRulesetImportStep(0);
@ -355,7 +355,7 @@ namespace osu.Game.Tests.Visual.SongSelect
Beatmap.Value = manager.GetWorkingBeatmap(target); Beatmap.Value = manager.GetWorkingBeatmap(target);
}); });
AddUntilStep("has selection", () => songSelect.Carousel.SelectedBeatmap.Equals(target)); AddUntilStep("has selection", () => songSelect.Carousel.SelectedBeatmapInfo.Equals(target));
// this is an important check, to make sure updateComponentFromBeatmap() was actually run // this is an important check, to make sure updateComponentFromBeatmap() was actually run
AddUntilStep("selection shown on wedge", () => songSelect.CurrentBeatmapDetailsBeatmap.BeatmapInfo.Equals(target)); AddUntilStep("selection shown on wedge", () => songSelect.CurrentBeatmapDetailsBeatmap.BeatmapInfo.Equals(target));
@ -368,7 +368,7 @@ namespace osu.Game.Tests.Visual.SongSelect
changeRuleset(2); changeRuleset(2);
addRulesetImportStep(2); addRulesetImportStep(2);
AddUntilStep("has selection", () => songSelect.Carousel.SelectedBeatmap.RulesetID == 2); AddUntilStep("has selection", () => songSelect.Carousel.SelectedBeatmapInfo.RulesetID == 2);
addRulesetImportStep(0); addRulesetImportStep(0);
addRulesetImportStep(0); addRulesetImportStep(0);
@ -385,7 +385,7 @@ namespace osu.Game.Tests.Visual.SongSelect
Ruleset.Value = rulesets.AvailableRulesets.First(r => r.ID == 0); Ruleset.Value = rulesets.AvailableRulesets.First(r => r.ID == 0);
}); });
AddUntilStep("has selection", () => songSelect.Carousel.SelectedBeatmap.Equals(target)); AddUntilStep("has selection", () => songSelect.Carousel.SelectedBeatmapInfo.Equals(target));
AddUntilStep("has correct ruleset", () => Ruleset.Value.ID == 0); AddUntilStep("has correct ruleset", () => Ruleset.Value.ID == 0);
@ -444,7 +444,7 @@ namespace osu.Game.Tests.Visual.SongSelect
{ {
createSongSelect(); createSongSelect();
addManyTestMaps(); addManyTestMaps();
AddUntilStep("has selection", () => songSelect.Carousel.SelectedBeatmap != null); AddUntilStep("has selection", () => songSelect.Carousel.SelectedBeatmapInfo != null);
bool startRequested = false; bool startRequested = false;
@ -473,13 +473,13 @@ namespace osu.Game.Tests.Visual.SongSelect
// used for filter check below // used for filter check below
AddStep("allow convert display", () => config.SetValue(OsuSetting.ShowConvertedBeatmaps, true)); AddStep("allow convert display", () => config.SetValue(OsuSetting.ShowConvertedBeatmaps, true));
AddUntilStep("has selection", () => songSelect.Carousel.SelectedBeatmap != null); AddUntilStep("has selection", () => songSelect.Carousel.SelectedBeatmapInfo != null);
AddStep("set filter text", () => songSelect.FilterControl.ChildrenOfType<SearchTextBox>().First().Text = "nonono"); AddStep("set filter text", () => songSelect.FilterControl.ChildrenOfType<SearchTextBox>().First().Text = "nonono");
AddUntilStep("dummy selected", () => Beatmap.Value is DummyWorkingBeatmap); AddUntilStep("dummy selected", () => Beatmap.Value is DummyWorkingBeatmap);
AddUntilStep("has no selection", () => songSelect.Carousel.SelectedBeatmap == null); AddUntilStep("has no selection", () => songSelect.Carousel.SelectedBeatmapInfo == null);
BeatmapInfo target = null; BeatmapInfo target = null;
@ -494,7 +494,7 @@ namespace osu.Game.Tests.Visual.SongSelect
Beatmap.Value = manager.GetWorkingBeatmap(target); Beatmap.Value = manager.GetWorkingBeatmap(target);
}); });
AddUntilStep("has selection", () => songSelect.Carousel.SelectedBeatmap != null); AddUntilStep("has selection", () => songSelect.Carousel.SelectedBeatmapInfo != null);
AddAssert("selected only shows expected ruleset (plus converts)", () => AddAssert("selected only shows expected ruleset (plus converts)", () =>
{ {
@ -502,16 +502,16 @@ namespace osu.Game.Tests.Visual.SongSelect
// special case for converts checked here. // special case for converts checked here.
return selectedPanel.ChildrenOfType<FilterableDifficultyIcon>().All(i => return selectedPanel.ChildrenOfType<FilterableDifficultyIcon>().All(i =>
i.IsFiltered || i.Item.Beatmap.Ruleset.ID == targetRuleset || i.Item.Beatmap.Ruleset.ID == 0); i.IsFiltered || i.Item.BeatmapInfo.Ruleset.ID == targetRuleset || i.Item.BeatmapInfo.Ruleset.ID == 0);
}); });
AddUntilStep("carousel has correct", () => songSelect.Carousel.SelectedBeatmap?.OnlineBeatmapID == target.OnlineBeatmapID); AddUntilStep("carousel has correct", () => songSelect.Carousel.SelectedBeatmapInfo?.OnlineBeatmapID == target.OnlineBeatmapID);
AddUntilStep("game has correct", () => Beatmap.Value.BeatmapInfo.OnlineBeatmapID == target.OnlineBeatmapID); AddUntilStep("game has correct", () => Beatmap.Value.BeatmapInfo.OnlineBeatmapID == target.OnlineBeatmapID);
AddStep("reset filter text", () => songSelect.FilterControl.ChildrenOfType<SearchTextBox>().First().Text = string.Empty); AddStep("reset filter text", () => songSelect.FilterControl.ChildrenOfType<SearchTextBox>().First().Text = string.Empty);
AddAssert("game still correct", () => Beatmap.Value?.BeatmapInfo.OnlineBeatmapID == target.OnlineBeatmapID); AddAssert("game still correct", () => Beatmap.Value?.BeatmapInfo.OnlineBeatmapID == target.OnlineBeatmapID);
AddAssert("carousel still correct", () => songSelect.Carousel.SelectedBeatmap.OnlineBeatmapID == target.OnlineBeatmapID); AddAssert("carousel still correct", () => songSelect.Carousel.SelectedBeatmapInfo.OnlineBeatmapID == target.OnlineBeatmapID);
} }
[Test] [Test]
@ -522,13 +522,13 @@ namespace osu.Game.Tests.Visual.SongSelect
changeRuleset(0); changeRuleset(0);
AddUntilStep("has selection", () => songSelect.Carousel.SelectedBeatmap != null); AddUntilStep("has selection", () => songSelect.Carousel.SelectedBeatmapInfo != null);
AddStep("set filter text", () => songSelect.FilterControl.ChildrenOfType<SearchTextBox>().First().Text = "nonono"); AddStep("set filter text", () => songSelect.FilterControl.ChildrenOfType<SearchTextBox>().First().Text = "nonono");
AddUntilStep("dummy selected", () => Beatmap.Value is DummyWorkingBeatmap); AddUntilStep("dummy selected", () => Beatmap.Value is DummyWorkingBeatmap);
AddUntilStep("has no selection", () => songSelect.Carousel.SelectedBeatmap == null); AddUntilStep("has no selection", () => songSelect.Carousel.SelectedBeatmapInfo == null);
BeatmapInfo target = null; BeatmapInfo target = null;
@ -540,15 +540,15 @@ namespace osu.Game.Tests.Visual.SongSelect
Beatmap.Value = manager.GetWorkingBeatmap(target); Beatmap.Value = manager.GetWorkingBeatmap(target);
}); });
AddUntilStep("has selection", () => songSelect.Carousel.SelectedBeatmap != null); AddUntilStep("has selection", () => songSelect.Carousel.SelectedBeatmapInfo != null);
AddUntilStep("carousel has correct", () => songSelect.Carousel.SelectedBeatmap?.OnlineBeatmapID == target.OnlineBeatmapID); AddUntilStep("carousel has correct", () => songSelect.Carousel.SelectedBeatmapInfo?.OnlineBeatmapID == target.OnlineBeatmapID);
AddUntilStep("game has correct", () => Beatmap.Value.BeatmapInfo.OnlineBeatmapID == target.OnlineBeatmapID); AddUntilStep("game has correct", () => Beatmap.Value.BeatmapInfo.OnlineBeatmapID == target.OnlineBeatmapID);
AddStep("set filter text", () => songSelect.FilterControl.ChildrenOfType<SearchTextBox>().First().Text = "nononoo"); AddStep("set filter text", () => songSelect.FilterControl.ChildrenOfType<SearchTextBox>().First().Text = "nononoo");
AddUntilStep("game lost selection", () => Beatmap.Value is DummyWorkingBeatmap); AddUntilStep("game lost selection", () => Beatmap.Value is DummyWorkingBeatmap);
AddAssert("carousel lost selection", () => songSelect.Carousel.SelectedBeatmap == null); AddAssert("carousel lost selection", () => songSelect.Carousel.SelectedBeatmapInfo == null);
} }
[Test] [Test]
@ -581,9 +581,9 @@ namespace osu.Game.Tests.Visual.SongSelect
createSongSelect(); createSongSelect();
addRulesetImportStep(0); addRulesetImportStep(0);
AddStep("Move to last difficulty", () => songSelect.Carousel.SelectBeatmap(songSelect.Carousel.BeatmapSets.First().Beatmaps.Last())); AddStep("Move to last difficulty", () => songSelect.Carousel.SelectBeatmap(songSelect.Carousel.BeatmapSets.First().Beatmaps.Last()));
AddStep("Store current ID", () => previousID = songSelect.Carousel.SelectedBeatmap.ID); AddStep("Store current ID", () => previousID = songSelect.Carousel.SelectedBeatmapInfo.ID);
AddStep("Hide first beatmap", () => manager.Hide(songSelect.Carousel.SelectedBeatmapSet.Beatmaps.First())); AddStep("Hide first beatmap", () => manager.Hide(songSelect.Carousel.SelectedBeatmapSet.Beatmaps.First()));
AddAssert("Selected beatmap has not changed", () => songSelect.Carousel.SelectedBeatmap.ID == previousID); AddAssert("Selected beatmap has not changed", () => songSelect.Carousel.SelectedBeatmapInfo.ID == previousID);
} }
[Test] [Test]
@ -641,7 +641,7 @@ namespace osu.Game.Tests.Visual.SongSelect
InputManager.Click(MouseButton.Left); InputManager.Click(MouseButton.Left);
}); });
AddAssert("Selected beatmap correct", () => songSelect.Carousel.SelectedBeatmap == filteredBeatmap); AddAssert("Selected beatmap correct", () => songSelect.Carousel.SelectedBeatmapInfo == filteredBeatmap);
} }
[Test] [Test]
@ -717,7 +717,7 @@ namespace osu.Game.Tests.Visual.SongSelect
AddStep("Find an icon for different ruleset", () => AddStep("Find an icon for different ruleset", () =>
{ {
difficultyIcon = set.ChildrenOfType<FilterableDifficultyIcon>() difficultyIcon = set.ChildrenOfType<FilterableDifficultyIcon>()
.First(icon => icon.Item.Beatmap.Ruleset.ID == 3); .First(icon => icon.Item.BeatmapInfo.Ruleset.ID == 3);
}); });
AddAssert("Check ruleset is osu!", () => Ruleset.Value.ID == 0); AddAssert("Check ruleset is osu!", () => Ruleset.Value.ID == 0);
@ -735,7 +735,7 @@ namespace osu.Game.Tests.Visual.SongSelect
AddUntilStep("Check ruleset changed to mania", () => Ruleset.Value.ID == 3); AddUntilStep("Check ruleset changed to mania", () => Ruleset.Value.ID == 3);
AddAssert("Selected beatmap still same set", () => songSelect.Carousel.SelectedBeatmap.BeatmapSet.ID == previousSetID); AddAssert("Selected beatmap still same set", () => songSelect.Carousel.SelectedBeatmapInfo.BeatmapSet.ID == previousSetID);
AddAssert("Selected beatmap is mania", () => Beatmap.Value.BeatmapInfo.Ruleset.ID == 3); AddAssert("Selected beatmap is mania", () => Beatmap.Value.BeatmapInfo.Ruleset.ID == 3);
} }
@ -767,7 +767,7 @@ namespace osu.Game.Tests.Visual.SongSelect
AddStep("Find group icon for different ruleset", () => AddStep("Find group icon for different ruleset", () =>
{ {
groupIcon = set.ChildrenOfType<FilterableGroupedDifficultyIcon>() groupIcon = set.ChildrenOfType<FilterableGroupedDifficultyIcon>()
.First(icon => icon.Items.First().Beatmap.Ruleset.ID == 3); .First(icon => icon.Items.First().BeatmapInfo.Ruleset.ID == 3);
}); });
AddAssert("Check ruleset is osu!", () => Ruleset.Value.ID == 0); AddAssert("Check ruleset is osu!", () => Ruleset.Value.ID == 0);
@ -781,7 +781,7 @@ namespace osu.Game.Tests.Visual.SongSelect
AddUntilStep("Check ruleset changed to mania", () => Ruleset.Value.ID == 3); AddUntilStep("Check ruleset changed to mania", () => Ruleset.Value.ID == 3);
AddAssert("Check first item in group selected", () => Beatmap.Value.BeatmapInfo.Equals(groupIcon.Items.First().Beatmap)); AddAssert("Check first item in group selected", () => Beatmap.Value.BeatmapInfo.Equals(groupIcon.Items.First().BeatmapInfo));
} }
[Test] [Test]
@ -856,7 +856,7 @@ namespace osu.Game.Tests.Visual.SongSelect
private int getBeatmapIndex(BeatmapSetInfo set, BeatmapInfo info) => set.Beatmaps.FindIndex(b => b == info); private int getBeatmapIndex(BeatmapSetInfo set, BeatmapInfo info) => set.Beatmaps.FindIndex(b => b == info);
private int getCurrentBeatmapIndex() => getBeatmapIndex(songSelect.Carousel.SelectedBeatmapSet, songSelect.Carousel.SelectedBeatmap); private int getCurrentBeatmapIndex() => getBeatmapIndex(songSelect.Carousel.SelectedBeatmapSet, songSelect.Carousel.SelectedBeatmapInfo);
private int getDifficultyIconIndex(DrawableCarouselBeatmapSet set, FilterableDifficultyIcon icon) private int getDifficultyIconIndex(DrawableCarouselBeatmapSet set, FilterableDifficultyIcon icon)
{ {

View File

@ -21,22 +21,22 @@ namespace osu.Game.Tournament.Components
{ {
public class SongBar : CompositeDrawable public class SongBar : CompositeDrawable
{ {
private BeatmapInfo beatmap; private BeatmapInfo beatmapInfo;
public const float HEIGHT = 145 / 2f; public const float HEIGHT = 145 / 2f;
[Resolved] [Resolved]
private IBindable<RulesetInfo> ruleset { get; set; } private IBindable<RulesetInfo> ruleset { get; set; }
public BeatmapInfo Beatmap public BeatmapInfo BeatmapInfo
{ {
get => beatmap; get => beatmapInfo;
set set
{ {
if (beatmap == value) if (beatmapInfo == value)
return; return;
beatmap = value; beatmapInfo = value;
update(); update();
} }
} }
@ -95,18 +95,18 @@ namespace osu.Game.Tournament.Components
private void update() private void update()
{ {
if (beatmap == null) if (beatmapInfo == null)
{ {
flow.Clear(); flow.Clear();
return; return;
} }
var bpm = beatmap.BeatmapSet.OnlineInfo.BPM; var bpm = beatmapInfo.BeatmapSet.OnlineInfo.BPM;
var length = beatmap.Length; var length = beatmapInfo.Length;
string hardRockExtra = ""; string hardRockExtra = "";
string srExtra = ""; string srExtra = "";
var ar = beatmap.BaseDifficulty.ApproachRate; var ar = beatmapInfo.BaseDifficulty.ApproachRate;
if ((mods & LegacyMods.HardRock) > 0) if ((mods & LegacyMods.HardRock) > 0)
{ {
@ -132,9 +132,9 @@ namespace osu.Game.Tournament.Components
default: default:
stats = new (string heading, string content)[] stats = new (string heading, string content)[]
{ {
("CS", $"{beatmap.BaseDifficulty.CircleSize:0.#}{hardRockExtra}"), ("CS", $"{beatmapInfo.BaseDifficulty.CircleSize:0.#}{hardRockExtra}"),
("AR", $"{ar:0.#}{hardRockExtra}"), ("AR", $"{ar:0.#}{hardRockExtra}"),
("OD", $"{beatmap.BaseDifficulty.OverallDifficulty:0.#}{hardRockExtra}"), ("OD", $"{beatmapInfo.BaseDifficulty.OverallDifficulty:0.#}{hardRockExtra}"),
}; };
break; break;
@ -142,15 +142,15 @@ namespace osu.Game.Tournament.Components
case 3: case 3:
stats = new (string heading, string content)[] stats = new (string heading, string content)[]
{ {
("OD", $"{beatmap.BaseDifficulty.OverallDifficulty:0.#}{hardRockExtra}"), ("OD", $"{beatmapInfo.BaseDifficulty.OverallDifficulty:0.#}{hardRockExtra}"),
("HP", $"{beatmap.BaseDifficulty.DrainRate:0.#}{hardRockExtra}") ("HP", $"{beatmapInfo.BaseDifficulty.DrainRate:0.#}{hardRockExtra}")
}; };
break; break;
case 2: case 2:
stats = new (string heading, string content)[] stats = new (string heading, string content)[]
{ {
("CS", $"{beatmap.BaseDifficulty.CircleSize:0.#}{hardRockExtra}"), ("CS", $"{beatmapInfo.BaseDifficulty.CircleSize:0.#}{hardRockExtra}"),
("AR", $"{ar:0.#}"), ("AR", $"{ar:0.#}"),
}; };
break; break;
@ -186,7 +186,7 @@ namespace osu.Game.Tournament.Components
Children = new Drawable[] Children = new Drawable[]
{ {
new DiffPiece(stats), new DiffPiece(stats),
new DiffPiece(("Star Rating", $"{beatmap.StarDifficulty:0.#}{srExtra}")) new DiffPiece(("Star Rating", $"{beatmapInfo.StarDifficulty:0.#}{srExtra}"))
} }
}, },
new FillFlowContainer new FillFlowContainer
@ -229,7 +229,7 @@ namespace osu.Game.Tournament.Components
} }
} }
}, },
new TournamentBeatmapPanel(beatmap) new TournamentBeatmapPanel(beatmapInfo)
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
Width = 0.5f, Width = 0.5f,

View File

@ -40,7 +40,7 @@ namespace osu.Game.Tournament.Screens
private void beatmapChanged(ValueChangedEvent<BeatmapInfo> beatmap) private void beatmapChanged(ValueChangedEvent<BeatmapInfo> beatmap)
{ {
SongBar.FadeInFromZero(300, Easing.OutQuint); SongBar.FadeInFromZero(300, Easing.OutQuint);
SongBar.Beatmap = beatmap.NewValue; SongBar.BeatmapInfo = beatmap.NewValue;
} }
} }
} }

View File

@ -38,16 +38,16 @@ namespace osu.Game.Overlays.BeatmapSet
} }
} }
private BeatmapInfo beatmap; private BeatmapInfo beatmapInfo;
public BeatmapInfo Beatmap public BeatmapInfo BeatmapInfo
{ {
get => beatmap; get => beatmapInfo;
set set
{ {
if (value == beatmap) return; if (value == beatmapInfo) return;
beatmap = value; beatmapInfo = value;
updateDisplay(); updateDisplay();
} }
@ -57,7 +57,7 @@ namespace osu.Game.Overlays.BeatmapSet
{ {
bpm.Value = BeatmapSet?.OnlineInfo?.BPM.ToLocalisableString(@"0.##") ?? (LocalisableString)"-"; bpm.Value = BeatmapSet?.OnlineInfo?.BPM.ToLocalisableString(@"0.##") ?? (LocalisableString)"-";
if (beatmap == null) if (beatmapInfo == null)
{ {
length.Value = string.Empty; length.Value = string.Empty;
circleCount.Value = string.Empty; circleCount.Value = string.Empty;
@ -65,11 +65,11 @@ namespace osu.Game.Overlays.BeatmapSet
} }
else else
{ {
length.TooltipText = BeatmapsetsStrings.ShowStatsTotalLength(TimeSpan.FromMilliseconds(beatmap.Length).ToFormattedDuration()); length.TooltipText = BeatmapsetsStrings.ShowStatsTotalLength(TimeSpan.FromMilliseconds(beatmapInfo.Length).ToFormattedDuration());
length.Value = TimeSpan.FromMilliseconds(beatmap.Length).ToFormattedDuration(); length.Value = TimeSpan.FromMilliseconds(beatmapInfo.Length).ToFormattedDuration();
circleCount.Value = beatmap.OnlineInfo.CircleCount.ToLocalisableString(@"N0"); circleCount.Value = beatmapInfo.OnlineInfo.CircleCount.ToLocalisableString(@"N0");
sliderCount.Value = beatmap.OnlineInfo.SliderCount.ToLocalisableString(@"N0"); sliderCount.Value = beatmapInfo.OnlineInfo.SliderCount.ToLocalisableString(@"N0");
} }
} }

View File

@ -211,7 +211,7 @@ namespace osu.Game.Overlays.BeatmapSet
Picker.Beatmap.ValueChanged += b => Picker.Beatmap.ValueChanged += b =>
{ {
Details.Beatmap = b.NewValue; Details.BeatmapInfo = b.NewValue;
externalLink.Link = $@"{api.WebsiteRootUrl}/beatmapsets/{BeatmapSet.Value?.OnlineBeatmapSetID}#{b.NewValue?.Ruleset.ShortName}/{b.NewValue?.OnlineBeatmapID}"; externalLink.Link = $@"{api.WebsiteRootUrl}/beatmapsets/{BeatmapSet.Value?.OnlineBeatmapSetID}#{b.NewValue?.Ruleset.ShortName}/{b.NewValue?.OnlineBeatmapID}";
}; };
} }

View File

@ -37,16 +37,16 @@ namespace osu.Game.Overlays.BeatmapSet
} }
} }
private BeatmapInfo beatmap; private BeatmapInfo beatmapInfo;
public BeatmapInfo Beatmap public BeatmapInfo BeatmapInfo
{ {
get => beatmap; get => beatmapInfo;
set set
{ {
if (value == beatmap) return; if (value == beatmapInfo) return;
basic.Beatmap = advanced.Beatmap = beatmap = value; basic.BeatmapInfo = advanced.BeatmapInfo = beatmapInfo = value;
} }
} }

View File

@ -48,7 +48,7 @@ namespace osu.Game.Screens.Select
/// <summary> /// <summary>
/// The currently selected beatmap. /// The currently selected beatmap.
/// </summary> /// </summary>
public BeatmapInfo SelectedBeatmap => selectedBeatmap?.Beatmap; public BeatmapInfo SelectedBeatmapInfo => selectedBeatmap?.BeatmapInfo;
private CarouselBeatmap selectedBeatmap => selectedBeatmapSet?.Beatmaps.FirstOrDefault(s => s.State.Value == CarouselItemState.Selected); private CarouselBeatmap selectedBeatmap => selectedBeatmapSet?.Beatmaps.FirstOrDefault(s => s.State.Value == CarouselItemState.Selected);
@ -65,7 +65,7 @@ namespace osu.Game.Screens.Select
private CarouselBeatmapSet selectedBeatmapSet; private CarouselBeatmapSet selectedBeatmapSet;
/// <summary> /// <summary>
/// Raised when the <see cref="SelectedBeatmap"/> is changed. /// Raised when the <see cref="SelectedBeatmapInfo"/> is changed.
/// </summary> /// </summary>
public Action<BeatmapInfo> SelectionChanged; public Action<BeatmapInfo> SelectionChanged;
@ -212,7 +212,7 @@ namespace osu.Game.Screens.Select
// If the selected beatmap is about to be removed, store its ID so it can be re-selected if required // If the selected beatmap is about to be removed, store its ID so it can be re-selected if required
if (existingSet?.State?.Value == CarouselItemState.Selected) if (existingSet?.State?.Value == CarouselItemState.Selected)
previouslySelectedID = selectedBeatmap?.Beatmap.ID; previouslySelectedID = selectedBeatmap?.BeatmapInfo.ID;
var newSet = createCarouselSet(beatmapSet); var newSet = createCarouselSet(beatmapSet);
@ -233,7 +233,7 @@ namespace osu.Game.Screens.Select
// check if we can/need to maintain our current selection. // check if we can/need to maintain our current selection.
if (previouslySelectedID != null) if (previouslySelectedID != null)
select((CarouselItem)newSet.Beatmaps.FirstOrDefault(b => b.Beatmap.ID == previouslySelectedID) ?? newSet); select((CarouselItem)newSet.Beatmaps.FirstOrDefault(b => b.BeatmapInfo.ID == previouslySelectedID) ?? newSet);
itemsCache.Invalidate(); itemsCache.Invalidate();
Schedule(() => BeatmapSetsChanged?.Invoke()); Schedule(() => BeatmapSetsChanged?.Invoke());
@ -258,7 +258,7 @@ namespace osu.Game.Screens.Select
if (!bypassFilters && set.Filtered.Value) if (!bypassFilters && set.Filtered.Value)
continue; continue;
var item = set.Beatmaps.FirstOrDefault(p => p.Beatmap.Equals(beatmap)); var item = set.Beatmaps.FirstOrDefault(p => p.BeatmapInfo.Equals(beatmap));
if (item == null) if (item == null)
// The beatmap that needs to be selected doesn't exist in this set // The beatmap that needs to be selected doesn't exist in this set
@ -472,7 +472,7 @@ namespace osu.Game.Screens.Select
private float? scrollTarget; private float? scrollTarget;
/// <summary> /// <summary>
/// Scroll to the current <see cref="SelectedBeatmap"/>. /// Scroll to the current <see cref="SelectedBeatmapInfo"/>.
/// </summary> /// </summary>
/// <param name="immediate"> /// <param name="immediate">
/// Whether the scroll position should immediately be shifted to the target, delegating animation to visible panels. /// Whether the scroll position should immediately be shifted to the target, delegating animation to visible panels.
@ -720,7 +720,7 @@ namespace osu.Game.Screens.Select
if (state.NewValue == CarouselItemState.Selected) if (state.NewValue == CarouselItemState.Selected)
{ {
selectedBeatmapSet = set; selectedBeatmapSet = set;
SelectionChanged?.Invoke(c.Beatmap); SelectionChanged?.Invoke(c.BeatmapInfo);
itemsCache.Invalidate(); itemsCache.Invalidate();
ScrollToSelected(); ScrollToSelected();

View File

@ -170,7 +170,7 @@ namespace osu.Game.Screens.Select
private void updateStatistics() private void updateStatistics()
{ {
advanced.Beatmap = Beatmap; advanced.BeatmapInfo = Beatmap;
description.Text = Beatmap?.Version; description.Text = Beatmap?.Version;
source.Text = Beatmap?.Metadata?.Source; source.Text = Beatmap?.Metadata?.Source;
tags.Text = Beatmap?.Metadata?.Tags; tags.Text = Beatmap?.Metadata?.Tags;

View File

@ -12,11 +12,11 @@ namespace osu.Game.Screens.Select.Carousel
{ {
public override float TotalHeight => DrawableCarouselBeatmap.HEIGHT; public override float TotalHeight => DrawableCarouselBeatmap.HEIGHT;
public readonly BeatmapInfo Beatmap; public readonly BeatmapInfo BeatmapInfo;
public CarouselBeatmap(BeatmapInfo beatmap) public CarouselBeatmap(BeatmapInfo beatmapInfo)
{ {
Beatmap = beatmap; BeatmapInfo = beatmapInfo;
State.Value = CarouselItemState.Collapsed; State.Value = CarouselItemState.Collapsed;
} }
@ -28,36 +28,36 @@ namespace osu.Game.Screens.Select.Carousel
bool match = bool match =
criteria.Ruleset == null || criteria.Ruleset == null ||
Beatmap.RulesetID == criteria.Ruleset.ID || BeatmapInfo.RulesetID == criteria.Ruleset.ID ||
(Beatmap.RulesetID == 0 && criteria.Ruleset.ID > 0 && criteria.AllowConvertedBeatmaps); (BeatmapInfo.RulesetID == 0 && criteria.Ruleset.ID > 0 && criteria.AllowConvertedBeatmaps);
if (Beatmap.BeatmapSet?.Equals(criteria.SelectedBeatmapSet) == true) if (BeatmapInfo.BeatmapSet?.Equals(criteria.SelectedBeatmapSet) == true)
{ {
// only check ruleset equality or convertability for selected beatmap // only check ruleset equality or convertability for selected beatmap
Filtered.Value = !match; Filtered.Value = !match;
return; return;
} }
match &= !criteria.StarDifficulty.HasFilter || criteria.StarDifficulty.IsInRange(Beatmap.StarDifficulty); match &= !criteria.StarDifficulty.HasFilter || criteria.StarDifficulty.IsInRange(BeatmapInfo.StarDifficulty);
match &= !criteria.ApproachRate.HasFilter || criteria.ApproachRate.IsInRange(Beatmap.BaseDifficulty.ApproachRate); match &= !criteria.ApproachRate.HasFilter || criteria.ApproachRate.IsInRange(BeatmapInfo.BaseDifficulty.ApproachRate);
match &= !criteria.DrainRate.HasFilter || criteria.DrainRate.IsInRange(Beatmap.BaseDifficulty.DrainRate); match &= !criteria.DrainRate.HasFilter || criteria.DrainRate.IsInRange(BeatmapInfo.BaseDifficulty.DrainRate);
match &= !criteria.CircleSize.HasFilter || criteria.CircleSize.IsInRange(Beatmap.BaseDifficulty.CircleSize); match &= !criteria.CircleSize.HasFilter || criteria.CircleSize.IsInRange(BeatmapInfo.BaseDifficulty.CircleSize);
match &= !criteria.OverallDifficulty.HasFilter || criteria.OverallDifficulty.IsInRange(Beatmap.BaseDifficulty.OverallDifficulty); match &= !criteria.OverallDifficulty.HasFilter || criteria.OverallDifficulty.IsInRange(BeatmapInfo.BaseDifficulty.OverallDifficulty);
match &= !criteria.Length.HasFilter || criteria.Length.IsInRange(Beatmap.Length); match &= !criteria.Length.HasFilter || criteria.Length.IsInRange(BeatmapInfo.Length);
match &= !criteria.BPM.HasFilter || criteria.BPM.IsInRange(Beatmap.BPM); match &= !criteria.BPM.HasFilter || criteria.BPM.IsInRange(BeatmapInfo.BPM);
match &= !criteria.BeatDivisor.HasFilter || criteria.BeatDivisor.IsInRange(Beatmap.BeatDivisor); match &= !criteria.BeatDivisor.HasFilter || criteria.BeatDivisor.IsInRange(BeatmapInfo.BeatDivisor);
match &= !criteria.OnlineStatus.HasFilter || criteria.OnlineStatus.IsInRange(Beatmap.Status); match &= !criteria.OnlineStatus.HasFilter || criteria.OnlineStatus.IsInRange(BeatmapInfo.Status);
match &= !criteria.Creator.HasFilter || criteria.Creator.Matches(Beatmap.Metadata.AuthorString); match &= !criteria.Creator.HasFilter || criteria.Creator.Matches(BeatmapInfo.Metadata.AuthorString);
match &= !criteria.Artist.HasFilter || criteria.Artist.Matches(Beatmap.Metadata.Artist) || match &= !criteria.Artist.HasFilter || criteria.Artist.Matches(BeatmapInfo.Metadata.Artist) ||
criteria.Artist.Matches(Beatmap.Metadata.ArtistUnicode); criteria.Artist.Matches(BeatmapInfo.Metadata.ArtistUnicode);
match &= !criteria.UserStarDifficulty.HasFilter || criteria.UserStarDifficulty.IsInRange(Beatmap.StarDifficulty); match &= !criteria.UserStarDifficulty.HasFilter || criteria.UserStarDifficulty.IsInRange(BeatmapInfo.StarDifficulty);
if (match) if (match)
{ {
var terms = Beatmap.SearchableTerms; var terms = BeatmapInfo.SearchableTerms;
foreach (var criteriaTerm in criteria.SearchTerms) foreach (var criteriaTerm in criteria.SearchTerms)
match &= terms.Any(term => term.Contains(criteriaTerm, StringComparison.InvariantCultureIgnoreCase)); match &= terms.Any(term => term.Contains(criteriaTerm, StringComparison.InvariantCultureIgnoreCase));
@ -66,16 +66,16 @@ namespace osu.Game.Screens.Select.Carousel
// this should be done after text matching so we can prioritise matching numbers in metadata. // this should be done after text matching so we can prioritise matching numbers in metadata.
if (!match && criteria.SearchNumber.HasValue) if (!match && criteria.SearchNumber.HasValue)
{ {
match = (Beatmap.OnlineBeatmapID == criteria.SearchNumber.Value) || match = (BeatmapInfo.OnlineBeatmapID == criteria.SearchNumber.Value) ||
(Beatmap.BeatmapSet?.OnlineBeatmapSetID == criteria.SearchNumber.Value); (BeatmapInfo.BeatmapSet?.OnlineBeatmapSetID == criteria.SearchNumber.Value);
} }
} }
if (match) if (match)
match &= criteria.Collection?.Beatmaps.Contains(Beatmap) ?? true; match &= criteria.Collection?.Beatmaps.Contains(BeatmapInfo) ?? true;
if (match && criteria.RulesetCriteria != null) if (match && criteria.RulesetCriteria != null)
match &= criteria.RulesetCriteria.Matches(Beatmap); match &= criteria.RulesetCriteria.Matches(BeatmapInfo);
Filtered.Value = !match; Filtered.Value = !match;
} }
@ -89,13 +89,13 @@ namespace osu.Game.Screens.Select.Carousel
{ {
default: default:
case SortMode.Difficulty: case SortMode.Difficulty:
var ruleset = Beatmap.RulesetID.CompareTo(otherBeatmap.Beatmap.RulesetID); var ruleset = BeatmapInfo.RulesetID.CompareTo(otherBeatmap.BeatmapInfo.RulesetID);
if (ruleset != 0) return ruleset; if (ruleset != 0) return ruleset;
return Beatmap.StarDifficulty.CompareTo(otherBeatmap.Beatmap.StarDifficulty); return BeatmapInfo.StarDifficulty.CompareTo(otherBeatmap.BeatmapInfo.StarDifficulty);
} }
} }
public override string ToString() => Beatmap.ToString(); public override string ToString() => BeatmapInfo.ToString();
} }
} }

View File

@ -47,8 +47,8 @@ namespace osu.Game.Screens.Select.Carousel
{ {
if (LastSelected == null || LastSelected.Filtered.Value) if (LastSelected == null || LastSelected.Filtered.Value)
{ {
if (GetRecommendedBeatmap?.Invoke(Children.OfType<CarouselBeatmap>().Where(b => !b.Filtered.Value).Select(b => b.Beatmap)) is BeatmapInfo recommended) if (GetRecommendedBeatmap?.Invoke(Children.OfType<CarouselBeatmap>().Where(b => !b.Filtered.Value).Select(b => b.BeatmapInfo)) is BeatmapInfo recommended)
return Children.OfType<CarouselBeatmap>().First(b => b.Beatmap == recommended); return Children.OfType<CarouselBeatmap>().First(b => b.BeatmapInfo == recommended);
} }
return base.GetNextToSelect(); return base.GetNextToSelect();
@ -91,7 +91,7 @@ namespace osu.Game.Screens.Select.Carousel
/// <summary> /// <summary>
/// All beatmaps which are not filtered and valid for display. /// All beatmaps which are not filtered and valid for display.
/// </summary> /// </summary>
protected IEnumerable<BeatmapInfo> ValidBeatmaps => Beatmaps.Where(b => !b.Filtered.Value || b.State.Value == CarouselItemState.Selected).Select(b => b.Beatmap); protected IEnumerable<BeatmapInfo> ValidBeatmaps => Beatmaps.Where(b => !b.Filtered.Value || b.State.Value == CarouselItemState.Selected).Select(b => b.BeatmapInfo);
private int compareUsingAggregateMax(CarouselBeatmapSet other, Func<BeatmapInfo, double> func) private int compareUsingAggregateMax(CarouselBeatmapSet other, Func<BeatmapInfo, double> func)
{ {

View File

@ -68,7 +68,7 @@ namespace osu.Game.Screens.Select.Carousel
public DrawableCarouselBeatmap(CarouselBeatmap panel) public DrawableCarouselBeatmap(CarouselBeatmap panel)
{ {
beatmap = panel.Beatmap; beatmap = panel.BeatmapInfo;
Item = panel; Item = panel;
} }

View File

@ -17,7 +17,7 @@ namespace osu.Game.Screens.Select.Carousel
public readonly CarouselBeatmap Item; public readonly CarouselBeatmap Item;
public FilterableDifficultyIcon(CarouselBeatmap item) public FilterableDifficultyIcon(CarouselBeatmap item)
: base(item.Beatmap, performBackgroundDifficultyLookup: false) : base(item.BeatmapInfo, performBackgroundDifficultyLookup: false)
{ {
filtered.BindTo(item.Filtered); filtered.BindTo(item.Filtered);
filtered.ValueChanged += isFiltered => Schedule(() => this.FadeTo(isFiltered.NewValue ? 0.1f : 1, 100)); filtered.ValueChanged += isFiltered => Schedule(() => this.FadeTo(isFiltered.NewValue ? 0.1f : 1, 100));

View File

@ -16,7 +16,7 @@ namespace osu.Game.Screens.Select.Carousel
public readonly List<CarouselBeatmap> Items; public readonly List<CarouselBeatmap> Items;
public FilterableGroupedDifficultyIcon(List<CarouselBeatmap> items, RulesetInfo ruleset) public FilterableGroupedDifficultyIcon(List<CarouselBeatmap> items, RulesetInfo ruleset)
: base(items.Select(i => i.Beatmap).ToList(), ruleset, Color4.White) : base(items.Select(i => i.BeatmapInfo).ToList(), ruleset, Color4.White)
{ {
Items = items; Items = items;

View File

@ -86,7 +86,7 @@ namespace osu.Game.Screens.Select.Carousel
var beatmaps = carouselSet.Beatmaps.ToList(); var beatmaps = carouselSet.Beatmaps.ToList();
return beatmaps.Count > maximum_difficulty_icons return beatmaps.Count > maximum_difficulty_icons
? (IEnumerable<DifficultyIcon>)beatmaps.GroupBy(b => b.Beatmap.Ruleset).Select(group => new FilterableGroupedDifficultyIcon(group.ToList(), group.Key)) ? (IEnumerable<DifficultyIcon>)beatmaps.GroupBy(b => b.BeatmapInfo.Ruleset).Select(group => new FilterableGroupedDifficultyIcon(group.ToList(), group.Key))
: beatmaps.Select(b => new FilterableDifficultyIcon(b)); : beatmaps.Select(b => new FilterableDifficultyIcon(b));
} }
} }

View File

@ -38,16 +38,16 @@ namespace osu.Game.Screens.Select.Details
protected readonly StatisticRow FirstValue, HpDrain, Accuracy, ApproachRate; protected readonly StatisticRow FirstValue, HpDrain, Accuracy, ApproachRate;
private readonly StatisticRow starDifficulty; private readonly StatisticRow starDifficulty;
private BeatmapInfo beatmap; private BeatmapInfo beatmapInfo;
public BeatmapInfo Beatmap public BeatmapInfo BeatmapInfo
{ {
get => beatmap; get => beatmapInfo;
set set
{ {
if (value == beatmap) return; if (value == beatmapInfo) return;
beatmap = value; beatmapInfo = value;
updateStatistics(); updateStatistics();
} }
@ -106,7 +106,7 @@ namespace osu.Game.Screens.Select.Details
private void updateStatistics() private void updateStatistics()
{ {
BeatmapDifficulty baseDifficulty = Beatmap?.BaseDifficulty; BeatmapDifficulty baseDifficulty = BeatmapInfo?.BaseDifficulty;
BeatmapDifficulty adjustedDifficulty = null; BeatmapDifficulty adjustedDifficulty = null;
if (baseDifficulty != null && mods.Value.Any(m => m is IApplicableToDifficulty)) if (baseDifficulty != null && mods.Value.Any(m => m is IApplicableToDifficulty))
@ -117,7 +117,7 @@ namespace osu.Game.Screens.Select.Details
mod.ApplyToDifficulty(adjustedDifficulty); mod.ApplyToDifficulty(adjustedDifficulty);
} }
switch (Beatmap?.Ruleset?.ID ?? 0) switch (BeatmapInfo?.Ruleset?.ID ?? 0)
{ {
case 3: case 3:
// Account for mania differences locally for now // Account for mania differences locally for now
@ -145,13 +145,13 @@ namespace osu.Game.Screens.Select.Details
{ {
starDifficultyCancellationSource?.Cancel(); starDifficultyCancellationSource?.Cancel();
if (Beatmap == null) if (BeatmapInfo == null)
return; return;
starDifficultyCancellationSource = new CancellationTokenSource(); starDifficultyCancellationSource = new CancellationTokenSource();
var normalStarDifficulty = difficultyCache.GetDifficultyAsync(Beatmap, ruleset.Value, null, starDifficultyCancellationSource.Token); var normalStarDifficulty = difficultyCache.GetDifficultyAsync(BeatmapInfo, ruleset.Value, null, starDifficultyCancellationSource.Token);
var moddedStarDifficulty = difficultyCache.GetDifficultyAsync(Beatmap, ruleset.Value, mods.Value, starDifficultyCancellationSource.Token); var moddedStarDifficulty = difficultyCache.GetDifficultyAsync(BeatmapInfo, ruleset.Value, mods.Value, starDifficultyCancellationSource.Token);
Task.WhenAll(normalStarDifficulty, moddedStarDifficulty).ContinueWith(_ => Schedule(() => Task.WhenAll(normalStarDifficulty, moddedStarDifficulty).ContinueWith(_ => Schedule(() =>
{ {

View File

@ -377,7 +377,7 @@ namespace osu.Game.Screens.Select
// avoid attempting to continue before a selection has been obtained. // avoid attempting to continue before a selection has been obtained.
// this could happen via a user interaction while the carousel is still in a loading state. // this could happen via a user interaction while the carousel is still in a loading state.
if (Carousel.SelectedBeatmap == null) return; if (Carousel.SelectedBeatmapInfo == null) return;
if (beatmap != null) if (beatmap != null)
Carousel.SelectBeatmap(beatmap); Carousel.SelectBeatmap(beatmap);