/// <summary> /// Transforms a <see cref="ChronoPivot"/> value into its delay in seconds. /// </summary> /// <param name="chrono">The chrono value.</param> /// <returns>Delay in seconds.</returns> internal static int GetDelay(this ChronoPivot chrono) { switch (chrono) { case ChronoPivot.Long: return(20); case ChronoPivot.Short: return(5); default: return(0); } }
// Affects a value to the human decision timer. private void SetChronoTime() { ChronoPivot chronoValue = (ChronoPivot)Properties.Settings.Default.ChronoSpeed; if (chronoValue == ChronoPivot.None) { _timer = null; } else if (_timer != null) { _timer.Interval = chronoValue.GetDelay() * 1000; } else { _timer = new System.Timers.Timer(chronoValue.GetDelay() * 1000); } }