More bindables!

This commit is contained in:
smoogipooo
2017-03-10 13:08:59 +09:00
parent f44fa56646
commit cd1717c42f
7 changed files with 64 additions and 60 deletions

View File

@ -8,7 +8,7 @@ using System;
namespace osu.Game.Graphics.UserInterface
{
public class ScoreCounter : RollingCounter<ulong>
public class ScoreCounter : RollingCounter<double>
{
protected override Type TransformType => typeof(TransformScore);
@ -34,24 +34,24 @@ namespace osu.Game.Graphics.UserInterface
LeadingZeroes = leading;
}
protected override double GetProportionalDuration(ulong currentValue, ulong newValue)
protected override double GetProportionalDuration(double currentValue, double newValue)
{
return currentValue > newValue ? currentValue - newValue : newValue - currentValue;
}
protected override string FormatCount(ulong count)
protected override string FormatCount(double count)
{
return count.ToString("D" + LeadingZeroes);
return ((long)count).ToString("D" + LeadingZeroes);
}
public override void Increment(ulong amount)
public override void Increment(double amount)
{
Count = Count + amount;
Current.Value = Current + amount;
}
protected class TransformScore : Transform<ulong>
protected class TransformScore : Transform<double>
{
protected override ulong CurrentValue
protected override double CurrentValue
{
get
{
@ -59,7 +59,7 @@ namespace osu.Game.Graphics.UserInterface
if (time < StartTime) return StartValue;
if (time >= EndTime) return EndValue;
return (ulong)Interpolation.ValueAt(time, StartValue, EndValue, StartTime, EndTime, Easing);
return Interpolation.ValueAt(time, (float)StartValue, (float)EndValue, StartTime, EndTime, Easing);
}
}