Exemplo n.º 1
0
        /// <summary>
        /// Advances the algorithm and updates the current step property.
        /// </summary>
        public void AdvanceAlgorithm()
        {
            if (!timerStarted)
            {
                timerStarted = true;
                Timer.initTimer(1000, OnTimerElapsed, true);
                Timer.startTimer();
            }

            if (CurrentPosition.Equals(Algorithm.FirstStep))
            {
                if (CurrentPosition.NextStep.RythmStyle == RythmStyle.Shockable)
                {
                    History.AddItem("Rytme vurderet - Stødbar");
                }
                else
                {
                    History.AddItem("Rytme vurderet - Ikke-Stødbar");
                }
            }
            else
            {
                History.AddItem(CurrentPosition.Name);
            }

            Algorithm.AdvanceOneStep();
            CurrentPosition = Algorithm.CurrentStep;
        }