Exemplo n.º 1
0
        /// <summary>
        /// Updates alarm. Returns true, if alarm is being triggered.
        /// </summary>
        public new virtual bool Update()
        {
            if (Enabled && Counter > 0)
            {
                Counter -= TimeKeeper.Time();

                if (Counter <= 0)
                {
                    TriggerEvent?.Invoke(this);
                    return(true);
                }
            }

            return(false);
        }
Exemplo n.º 2
0
 public Alarm(TimeKeeper timeKeeper) : base(timeKeeper)
 {
 }
Exemplo n.º 3
0
 public Alarm(TimeKeeper timeKeeper, Action <Alarm> triggerAction) : base(timeKeeper) =>
Exemplo n.º 4
0
 public AutoAlarm(double time, TimeKeeper timeKeeper, Action <Alarm> triggerAction) : base(timeKeeper, triggerAction)
 {
     Time = time;
     Set(Time);
 }
Exemplo n.º 5
0
 public AutoAlarm(double time, TimeKeeper timeKeeper) : base(timeKeeper)
 {
     Time = time;
     Set(Time);
 }