Example #1
0
        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();
        }
Example #2
0
        private void BeginPlay(ScoreInfo info)
        {
            var stopwatch = new Stopwatch();
            stopwatch.Start();

            output.PlayScoreStart(info.Username);

            do
            {
                PlayScore(info.Score, stopwatch);
            } while (shouldLoop);

            output.PlayScoreEnd();
        }