// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; namespace osu.Game.Graphics.Carousel { /// /// Represents a single display item for display in a . /// This is used to house information related to the attached model that helps with display and tracking. /// public sealed class CarouselItem : IComparable { public const float DEFAULT_HEIGHT = 45; /// /// The model this item is representing. /// public readonly object Model; /// /// The current Y position in the carousel. /// /// This is managed by and should not be set manually. /// public double CarouselYPosition { get; set; } /// /// The amount of input padding/lenience to be added to the area above this panel. /// Calculated as half of the calculated spacing between this panel and the panel above it. /// /// This is managed by and should not be set manually. /// public float CarouselInputLenienceAbove { get; set; } /// /// The amount of input padding/lenience to be added to the area below this panel. /// Calculated as half of the calculated spacing between this panel and the panel below it. /// /// This is managed by and should not be set manually. /// public float CarouselInputLenienceBelow { get; set; } /// /// The height this item will take when displayed. Defaults to . /// public float DrawHeight { get; set; } = DEFAULT_HEIGHT; /// /// Defines the display depth relative to other s. /// public int DepthLayer { get; set; } /// /// Whether this item is visible or hidden. /// public bool IsVisible { get; set; } = true; /// /// Whether this item is expanded or not. Should only be used for headers of groups. /// public bool IsExpanded { get; set; } /// /// The number of nested items underneath this header. Should only be used for headers of groups. /// public int NestedItemCount { get; set; } public CarouselItem(object model) { Model = model; } public int CompareTo(CarouselItem? other) { if (other == null) return 1; return CarouselYPosition.CompareTo(other.CarouselYPosition); } } }