1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-18 21:53:21 +08:00
osu-lazer/osu.Game/Screens/Play/HUD/ComboResultCounter.cs

33 lines
1.0 KiB
C#
Raw Normal View History

// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
2016-10-16 04:16:02 +08:00
using osu.Framework.Graphics;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Screens.Play.HUD
2016-10-16 04:16:02 +08:00
{
/// <summary>
/// Used to display combo with a roll-up animation in results screen.
/// </summary>
2017-07-15 00:14:07 +08:00
public class ComboResultCounter : RollingCounter<long>
2016-10-16 04:16:02 +08:00
{
2016-10-18 10:40:50 +08:00
protected override double RollingDuration => 500;
2017-07-23 02:50:25 +08:00
protected override Easing RollingEasing => Easing.Out;
2016-10-16 04:16:02 +08:00
2017-07-15 00:14:07 +08:00
protected override double GetProportionalDuration(long currentValue, long newValue)
2016-10-16 04:16:02 +08:00
{
return currentValue > newValue ? currentValue - newValue : newValue - currentValue;
}
2017-07-15 00:14:07 +08:00
protected override string FormatCount(long count)
2016-10-16 04:16:02 +08:00
{
return $@"{count}x";
}
2017-07-15 00:14:07 +08:00
public override void Increment(long amount)
{
2017-03-10 12:08:59 +08:00
Current.Value = Current + amount;
}
2016-10-16 04:16:02 +08:00
}
}