Example #1
0
 public static Countdown Queue(TimeSpan delay, DelayedAction action)
 {
     var counter = new Countdown();
     counter.Elapsed += (object sender, EventArgs e) => action();
     counter.Start(delay);
     return counter;
 }
Example #2
0
        public TestForm(Engine engine)
        {
            InitializeComponent();

            #if DEBUG
            TopMost = false;
            #endif

            _engine = engine;
            _random = new Random();
            _muteTimer = new Countdown();
            _muteTimer.Elapsed += MuteTimer_Elapsed;
            _vitalTimer = new Countdown();
            _vitalTimer.Elapsed += VitalTimer_Elapsed;
        }
Example #3
0
        public Engine()
        {
            _napTimer = new Countdown();
            _napTimer.Elapsed += NapTimer_Elapsed;
            _graceTimer = new Countdown();
            _graceTimer.Elapsed += GraceTimer_Elapsed;
            _warningTimer = new Countdown();
            _warningTimer.Elapsed += WarningTimer_Elapsed;
            _cooldownTimer = new Countdown();
            _cooldownTimer.Elapsed += CooldownTimer_Elapsed;
            _vitalTimer = new Countdown();
            _vitalTimer.Elapsed += VitalTimer_Elapsed;

            Hook += SelfHook;
        }