示例#1
0
文件: Alarm.cs 项目: SHHSSH/Monofoxe
        /// <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);
        }
示例#2
0
文件: Alarm.cs 项目: SHHSSH/Monofoxe
 public Alarm(TimeKeeper timeKeeper) : base(timeKeeper)
 {
 }
示例#3
0
 public Alarm(TimeKeeper timeKeeper, Action <Alarm> triggerAction) : base(timeKeeper) =>
示例#4
0
 public AutoAlarm(double time, TimeKeeper timeKeeper, Action <Alarm> triggerAction) : base(timeKeeper, triggerAction)
 {
     Time = time;
     Set(Time);
 }
示例#5
0
 public AutoAlarm(double time, TimeKeeper timeKeeper) : base(timeKeeper)
 {
     Time = time;
     Set(Time);
 }