//TODO:: allow end users to add more events to the throttle than the default // battery and fuel events. public bool hasThrottle(GuidEntity entity) { return((EventTypes.Contains(EventType.LowBattery) && ((Event)entity).EventType == EventType.LowBattery) || (EventTypes.Contains(EventType.LowFuel) && ((Event)entity).EventType == EventType.LowFuel)); }
public virtual bool isThrottled(GuidEntity entity) { // Now earlier than the next broadcast. return(Throttle != null && NextAllowedBroadcast != null && DateTime.Compare(DateTime.UtcNow, NextAllowedBroadcast.GetValueOrDefault()) < 0); }
public override bool UpdateThrottle(GuidEntity entity) { return(hasThrottle(entity) && Throttle != null); }
public override bool isThrottled(GuidEntity entity) { return(hasThrottle(entity) && base.isThrottled(entity)); }
public virtual bool UpdateThrottle(GuidEntity entity) { return(Throttle != null); }