// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. #nullable disable using System; using JetBrains.Annotations; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Localisation; namespace osu.Game.Screens.Ranking.Statistics { /// /// An item to be displayed in a row of statistics inside the results screen. /// public class StatisticItem { /// /// The name of this item. /// public readonly LocalisableString Name; /// /// A function returning the content to be displayed. /// public readonly Func CreateContent; /// /// The of this row. This can be thought of as the column dimension of an encompassing . /// public readonly Dimension Dimension; /// /// Whether this item requires hit events. If true, will not be called if no hit events are available. /// public readonly bool RequiresHitEvents; [Obsolete("Use constructor which takes creation function instead.")] // Can be removed 20220803. public StatisticItem([NotNull] string name, [NotNull] Drawable content, [CanBeNull] Dimension dimension = null) : this(name, () => content, true, dimension) { } /// /// Creates a new , to be displayed inside a in the results screen. /// /// The name of the item. Can be to hide the item header. /// A function returning the content to be displayed. /// Whether this item requires hit events. If true, will not be called if no hit events are available. /// The of this item. This can be thought of as the column dimension of an encompassing . public StatisticItem(LocalisableString name, [NotNull] Func createContent, bool requiresHitEvents = false, [CanBeNull] Dimension dimension = null) { Name = name; RequiresHitEvents = requiresHitEvents; CreateContent = createContent; Dimension = dimension; } } }