// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; namespace osu.Game.Skinning { /// /// An integer that uses number sprites from a legacy skin. /// public class LegacyRollingCounter : RollingCounter { private readonly ISkin skin; private readonly LegacyFont font; protected override bool IsRollingProportional => true; /// /// Creates a new . /// /// The from which to get counter number sprites. /// The legacy font to use for the counter. public LegacyRollingCounter(ISkin skin, LegacyFont font) { this.skin = skin; this.font = font; } protected override double GetProportionalDuration(int currentValue, int newValue) { return Math.Abs(newValue - currentValue) * 75.0; } protected sealed override OsuSpriteText CreateSpriteText() => new LegacySpriteText(skin, font); } }