예제 #1
0
        private void restoreStateTo(double time)
        {
            states.RemoveAll(state => state.Time > time);

            currentState = states.LastOrDefault();
            CountPresses = currentState?.Count ?? 0;
        }
예제 #2
0
 private void saveState()
 {
     if (currentState == null || currentState.Time < Clock.CurrentTime)
     {
         states.Add(currentState = new KeyCounterState(Clock.CurrentTime, CountPresses));
     }
 }