mirror of
https://github.com/ppy/osu.git
synced 2025-01-30 05:22: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
|
namespace osu.Game.Screens.SelectV2
|
||||||
{
|
{
|
||||||
[Cached]
|
[Cached]
|
||||||
public partial class BeatmapCarouselV2 : Carousel
|
public partial class BeatmapCarouselV2 : Carousel<BeatmapInfo>
|
||||||
{
|
{
|
||||||
private IBindableList<BeatmapSetInfo> detachedBeatmaps = null!;
|
private IBindableList<BeatmapSetInfo> detachedBeatmaps = null!;
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ namespace osu.Game.Screens.SelectV2
|
|||||||
return drawable;
|
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)
|
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,
|
/// 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.
|
/// but flexible enough to be used for other use cases.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract partial class Carousel : CompositeDrawable
|
public abstract partial class Carousel<T> : CompositeDrawable
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A collection of filters which should be run each time a <see cref="QueueFilter"/> is executed.
|
/// 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>
|
/// <remarks>
|
||||||
/// Note that an <see cref="ICarouselFilter"/> may add new items which are displayed but not tracked in this list.
|
/// Note that an <see cref="ICarouselFilter"/> may add new items which are displayed but not tracked in this list.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected readonly BindableList<object> Items = new BindableList<object>();
|
protected readonly BindableList<T> Items = new BindableList<T>();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The currently selected model.
|
/// The currently selected model.
|
||||||
@ -148,7 +148,7 @@ namespace osu.Game.Screens.SelectV2
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="model">The model.</param>
|
/// <param name="model">The model.</param>
|
||||||
/// <returns>A <see cref="CarouselItem"/> representing the model.</returns>
|
/// <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
|
#region Filtering and display preparation
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user