Make saveState private

This commit is contained in:
Dean Herbert 2018-09-15 16:34:08 +09:00
parent 7b57439976
commit 79b56cb35c

View File

@ -52,7 +52,7 @@ namespace osu.Game.Screens.Play
if (value && IsCounting) if (value && IsCounting)
{ {
CountPresses++; CountPresses++;
SaveState(); saveState();
} }
} }
} }
@ -142,12 +142,6 @@ namespace osu.Game.Screens.Play
states.Clear(); states.Clear();
} }
public void SaveState()
{
if (currentState == null || currentState.Time < Clock.CurrentTime)
states.Add(currentState = new KeyCounterState(Clock.CurrentTime, CountPresses));
}
protected override void Update() protected override void Update()
{ {
base.Update(); base.Update();
@ -156,6 +150,12 @@ namespace osu.Game.Screens.Play
restoreStateTo(Clock.CurrentTime); restoreStateTo(Clock.CurrentTime);
} }
private void saveState()
{
if (currentState == null || currentState.Time < Clock.CurrentTime)
states.Add(currentState = new KeyCounterState(Clock.CurrentTime, CountPresses));
}
private void restoreStateTo(double time) private void restoreStateTo(double time)
{ {
states.RemoveAll(state => state.Time > time); states.RemoveAll(state => state.Time > time);