示例#1
0
        public Performer(TimeSet timeSet)
        {
            this.TimeSet = timeSet;
            currentSecond = this.TimeSet.Duration;
            stages = this.TimeSet.ObservableStages.OrderByDescending(w => w.StagePoint).ToList();
            //mxaStagePoint = stages.Max(w => w.StagePoint);

            _readyCountDownCount = timeSet.SecendsToReady;
            var tm = DependencyService.Get<ITimer>();
            _heartBeatTimer = tm.New();
            _readyCountDownTimer = tm.New();
            _stageTimer = tm.New();

            //var b = _heartBeatTimer.Equals(_readyCountDownTimer);

            _heartBeatTimer.Interval = 1000;
            _heartBeatTimer.OnTick(HeartBeats);

            _readyCountDownTimer.Interval = 1000;
            _readyCountDownTimer.OnTick((t) =>
            {
                ReadyCountDown(t, () =>
                {
                    //stageTimer.Enabled = true;
                    //stageTimer.Start();
                    StartCountDown();
                    _heartBeatTimer.Enabled = true;
                    _heartBeatTimer.Start();
                });
            });

            _stageTimer.Interval = 1000;
            _stageTimer.OnTick((t) =>
            {
                StageCountDown(t);
            });
        }