Apply NRT to CarouselGroup

This commit is contained in:
Dean Herbert 2022-01-21 13:09:03 +09:00
parent 5b24800b0e
commit bed7b69464

View File

@ -3,7 +3,8 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using JetBrains.Annotations;
#nullable enable
namespace osu.Game.Screens.Select.Carousel namespace osu.Game.Screens.Select.Carousel
{ {
@ -12,7 +13,7 @@ namespace osu.Game.Screens.Select.Carousel
/// </summary> /// </summary>
public class CarouselGroup : CarouselItem public class CarouselGroup : CarouselItem
{ {
public override DrawableCarouselItem CreateDrawableRepresentation() => null; public override DrawableCarouselItem? CreateDrawableRepresentation() => null;
public IReadOnlyList<CarouselItem> Children => InternalChildren; public IReadOnlyList<CarouselItem> Children => InternalChildren;
@ -24,6 +25,10 @@ namespace osu.Game.Screens.Select.Carousel
/// </summary> /// </summary>
private ulong currentChildID; private ulong currentChildID;
private Comparer<CarouselItem>? criteriaComparer;
private FilterCriteria? lastCriteria;
public virtual void RemoveChild(CarouselItem i) public virtual void RemoveChild(CarouselItem i)
{ {
InternalChildren.Remove(i); InternalChildren.Remove(i);
@ -54,7 +59,7 @@ namespace osu.Game.Screens.Select.Carousel
} }
} }
public CarouselGroup(List<CarouselItem> items = null) public CarouselGroup(List<CarouselItem>? items = null)
{ {
if (items != null) InternalChildren = items; if (items != null) InternalChildren = items;
@ -77,11 +82,6 @@ namespace osu.Game.Screens.Select.Carousel
}; };
} }
private Comparer<CarouselItem> criteriaComparer;
[CanBeNull]
private FilterCriteria lastCriteria;
public override void Filter(FilterCriteria criteria) public override void Filter(FilterCriteria criteria)
{ {
base.Filter(criteria); base.Filter(criteria);