1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 23:27:24 +08:00
osu-lazer/osu.Game/Graphics/UserInterface/ScoreCounter.cs

45 lines
1.2 KiB
C#
Raw Normal View History

2016-10-07 15:24:46 +08:00
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework;
2016-10-07 15:24:46 +08:00
using System;
2016-10-07 15:05:02 +08:00
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace osu.Game.Graphics.UserInterface
{
public class ScoreCounter : ULongCounter
{
/// <summary>
/// How many leading zeroes the counter has.
2016-10-07 15:05:02 +08:00
/// </summary>
public uint LeadingZeroes
{
get;
protected set;
}
2016-10-07 15:05:02 +08:00
/// <summary>
/// Displays score.
/// </summary>
/// <param name="leading">How many leading zeroes the counter will have.</param>
public ScoreCounter(uint leading = 0) : base()
2016-10-13 03:33:04 +08:00
{
countSpriteText.FixedWidth = true;
LeadingZeroes = leading;
2016-10-13 03:33:04 +08:00
}
public override void Load(BaseGame game)
2016-10-09 10:58:53 +08:00
{
base.Load(game);
2016-10-09 10:58:53 +08:00
}
2016-10-07 15:05:02 +08:00
protected override string formatCount(ulong count)
{
return count.ToString("D" + LeadingZeroes);
}
}
}