예제 #1
0
        public void SkipSplit()
        {
            if ((CurrentState.CurrentPhase == TimerPhase.Running ||
                 CurrentState.CurrentPhase == TimerPhase.Paused) &&
                CurrentState.CurrentSplitIndex < CurrentState.Run.Count - 1)
            {
                var prevSplit       = CurrentState.CurrentSplit;
                var newCurrentSplit = CurrentState.Run[CurrentState.CurrentSplitIndex + 1];
                var isNextParent    = IsParentOf(newCurrentSplit, prevSplit);
                if (!isNextParent || CurrentState.CurrentSplitIndex < CurrentState.Run.Count - 2)
                {
                    CurrentState.CurrentSplit.DeathCount = -1;
                    DoSkipSplit();
                    if (isNextParent)
                    {
                        if (CheckAllSkipped())
                        {
                            CurrentState.CurrentSplit.DeathCount = -1;
                        }
                        DoSkipSplit();
                    }
                    if (CurrentState.Run.Count != CurrentState.CurrentSplitIndex)
                    {
                        CurrentState.CurrentSplit.DeathCount = 0;
                        if (CurrentState.CurrentSplit.Parent != null && !object.ReferenceEquals(CurrentState.CurrentSplit.Parent, prevSplit.Parent))
                        {
                            CurrentState.CurrentSplit.Parent.DeathCount = 0;
                        }
                    }

                    CurrentState.Run.HasChanged = true;
                    OnSkipSplit?.Invoke(this, null);
                }
            }
        }
예제 #2
0
        public void SkipSplit()
        {
            if ((CurrentState.CurrentPhase == TimerPhase.Running ||
                 CurrentState.CurrentPhase == TimerPhase.Paused) &&
                CurrentState.CurrentSplitIndex < CurrentState.Run.Count - 1)
            {
                CurrentState.CurrentSplit.SplitTime = default(Time);
                CurrentState.CurrentSplitIndex++;
                CurrentState.Run.HasChanged = true;

                OnSkipSplit?.Invoke(this, null);
            }
        }
예제 #3
0
 public void RegisterTimerModel(ITimerModel model)
 {
     model.OnSplit      += (s, e) => OnSplit?.Invoke(this, e);
     model.OnSkipSplit  += (s, e) => OnSkipSplit?.Invoke(this, e);
     model.OnUndoSplit  += (s, e) => OnUndoSplit?.Invoke(this, e);
     model.OnStart      += (s, e) => OnStart?.Invoke(this, e);
     model.OnReset      += (s, e) => OnReset?.Invoke(this, e);
     model.OnPause      += (s, e) => OnPause?.Invoke(this, e);
     model.OnResume     += (s, e) => OnResume?.Invoke(this, e);
     model.OnScrollUp   += (s, e) => OnScrollUp?.Invoke(this, e);
     model.OnScrollDown += (s, e) => OnScrollDown?.Invoke(this, e);
     model.OnSwitchComparisonPrevious += (s, e) => OnSwitchComparisonPrevious?.Invoke(this, e);
     model.OnSwitchComparisonNext     += (s, e) => OnSwitchComparisonNext?.Invoke(this, e);
 }
        public void SkipSplit()
        {
            switch (CurrentState.CurrentPhase)
            {
            case TimerPhase.Running:
            case TimerPhase.Paused:
                if (CurrentState.CurrentSplitIndex >= CurrentState.Run.Count - 1)
                {
                    return;
                }
                CurrentState.CurrentSplit.SplitTime = default(Time);
                CurrentState.CurrentSplitIndex++;
                CurrentState.Run.HasChanged = true;

                OnSkipSplit?.Invoke(this, null);
                break;

            default:
                return;
            }
        }
예제 #5
0
 public void OnBaseSkipSplit(object sender, EventArgs e)
 {
     OnSkipSplit?.Invoke(sender, e);
 }