Avoid accessing container in each counter.

This commit is contained in:
Huo Yaoyuan
2016-09-24 10:04:08 +08:00
parent c70bf53486
commit 0da0d4f35e
2 changed files with 20 additions and 4 deletions

View File

@ -17,7 +17,7 @@ namespace osu.Game.Graphics.UserInterface
private SpriteText countSpriteText;
public override string Name { get; }
public KeyCounterCollection ParentCounter { get; set; }
public bool IsCounting { get; set; }
public int Count { get; private set; }
private bool isLit;
@ -30,7 +30,7 @@ namespace osu.Game.Graphics.UserInterface
{
isLit = value;
UpdateGlowSprite();
if (value && ParentCounter.IsCounting)
if (value && IsCounting)
IncreaseCount();
}
}