public virtual void Play(ScoreInfo info, int tempo = 60) { SetTimeBetweenFrames(tempo); IsPlaying = true; shouldLoop = false; var worker = new BackgroundWorker(); worker.DoWork += (s, e) => BeginPlay(info); worker.RunWorkerCompleted += (s, e) => OnComplete(); worker.RunWorkerAsync(); }
private void BeginPlay(ScoreInfo info) { var stopwatch = new Stopwatch(); stopwatch.Start(); output.PlayScoreStart(info.Username); do { PlayScore(info.Score, stopwatch); } while (shouldLoop); output.PlayScoreEnd(); }