mirror of
https://github.com/ppy/osu.git
synced 2025-01-18 11:52:54 +08:00
Generic type instead of raw object
?
This commit is contained in:
parent
6fbab1bbce
commit
cf55fe16ab
@ -25,7 +25,7 @@ using osuTK.Graphics;
|
||||
namespace osu.Game.Screens.SelectV2
|
||||
{
|
||||
[Cached]
|
||||
public partial class BeatmapCarouselV2 : Carousel
|
||||
public partial class BeatmapCarouselV2 : Carousel<BeatmapInfo>
|
||||
{
|
||||
private IBindableList<BeatmapSetInfo> detachedBeatmaps = null!;
|
||||
|
||||
@ -60,7 +60,7 @@ namespace osu.Game.Screens.SelectV2
|
||||
return drawable;
|
||||
}
|
||||
|
||||
protected override CarouselItem CreateCarouselItemForModel(object model) => new BeatmapCarouselItem(model);
|
||||
protected override CarouselItem CreateCarouselItemForModel(BeatmapInfo model) => new BeatmapCarouselItem(model);
|
||||
|
||||
private void beatmapSetsChanged(object? beatmaps, NotifyCollectionChangedEventArgs changed)
|
||||
{
|
||||
|
@ -24,7 +24,7 @@ namespace osu.Game.Screens.SelectV2
|
||||
/// A highly efficient vertical list display that is used primarily for the song select screen,
|
||||
/// but flexible enough to be used for other use cases.
|
||||
/// </summary>
|
||||
public abstract partial class Carousel : CompositeDrawable
|
||||
public abstract partial class Carousel<T> : CompositeDrawable
|
||||
{
|
||||
/// <summary>
|
||||
/// A collection of filters which should be run each time a <see cref="QueueFilter"/> is executed.
|
||||
@ -80,7 +80,7 @@ namespace osu.Game.Screens.SelectV2
|
||||
/// <remarks>
|
||||
/// Note that an <see cref="ICarouselFilter"/> may add new items which are displayed but not tracked in this list.
|
||||
/// </remarks>
|
||||
protected readonly BindableList<object> Items = new BindableList<object>();
|
||||
protected readonly BindableList<T> Items = new BindableList<T>();
|
||||
|
||||
/// <summary>
|
||||
/// The currently selected model.
|
||||
@ -148,7 +148,7 @@ namespace osu.Game.Screens.SelectV2
|
||||
/// </summary>
|
||||
/// <param name="model">The model.</param>
|
||||
/// <returns>A <see cref="CarouselItem"/> representing the model.</returns>
|
||||
protected abstract CarouselItem CreateCarouselItemForModel(object model);
|
||||
protected abstract CarouselItem CreateCarouselItemForModel(T model);
|
||||
|
||||
#region Filtering and display preparation
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user