Locallise ChildItems to DrawableCarouselBeatmapSet for clarity

This commit is contained in:
Dean Herbert
2020-10-13 19:15:56 +09:00
parent 37daefc2b5
commit 5d11db7753
4 changed files with 3 additions and 7 deletions

View File

@ -923,7 +923,7 @@ namespace osu.Game.Tests.Visual.SongSelect
if (item is DrawableCarouselBeatmapSet set) if (item is DrawableCarouselBeatmapSet set)
{ {
foreach (var difficulty in set.ChildItems) foreach (var difficulty in set.DrawableBeatmaps)
yield return difficulty; yield return difficulty;
} }
} }

View File

@ -640,7 +640,7 @@ namespace osu.Game.Screens.Select
if (item is DrawableCarouselBeatmapSet set) if (item is DrawableCarouselBeatmapSet set)
{ {
foreach (var diff in set.ChildItems) foreach (var diff in set.DrawableBeatmaps)
updateItem(diff, item); updateItem(diff, item);
} }
} }

View File

@ -32,7 +32,7 @@ namespace osu.Game.Screens.Select.Carousel
[Resolved(CanBeNull = true)] [Resolved(CanBeNull = true)]
private ManageCollectionsDialog manageCollectionsDialog { get; set; } private ManageCollectionsDialog manageCollectionsDialog { get; set; }
public override IEnumerable<DrawableCarouselItem> ChildItems => beatmapContainer?.Children ?? base.ChildItems; public IEnumerable<DrawableCarouselItem> DrawableBeatmaps => beatmapContainer?.Children ?? Enumerable.Empty<DrawableCarouselItem>();
private BeatmapSetInfo beatmapSet => (Item as CarouselBeatmapSet)?.BeatmapSet; private BeatmapSetInfo beatmapSet => (Item as CarouselBeatmapSet)?.BeatmapSet;

View File

@ -1,9 +1,7 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Linq;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
@ -62,8 +60,6 @@ namespace osu.Game.Screens.Select.Carousel
} }
} }
public virtual IEnumerable<DrawableCarouselItem> ChildItems => Enumerable.Empty<DrawableCarouselItem>();
protected DrawableCarouselItem() protected DrawableCarouselItem()
{ {
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;