Skip to content

Commit

Permalink
Generic type instead of raw object?
Browse files Browse the repository at this point in the history
  • Loading branch information
peppy committed Jan 10, 2025
1 parent 4e87467 commit 97020bd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions osu.Game/Screens/SelectV2/BeatmapCarouselV2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
namespace osu.Game.Screens.SelectV2
{
[Cached]
public partial class BeatmapCarouselV2 : Carousel
public partial class BeatmapCarouselV2 : Carousel<BeatmapInfo>
{
private IBindableList<BeatmapSetInfo> detachedBeatmaps = null!;

Expand Down Expand Up @@ -60,7 +60,7 @@ protected override Drawable GetDrawableForDisplay(CarouselItem item)
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)
{
Expand Down
6 changes: 3 additions & 3 deletions osu.Game/Screens/SelectV2/Carousel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -80,7 +80,7 @@ public abstract partial class Carousel : CompositeDrawable
/// <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.
Expand Down Expand Up @@ -148,7 +148,7 @@ protected Carousel()
/// </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

Expand Down

0 comments on commit 97020bd

Please sign in to comment.