pub fn add_delta_duration(&mut self, delta_duration: f32) -> bool {
            self.dirty = false;
            if !self.running {
                return false;
            }

            match self.timer_type {
                TimerType::Manual => {
                    self.current_duration += delta_duration;
                    if self.current_duration >= self.total_duration {
                        self.running = false;
                        self.dirty = true;
                    }
                }
                TimerType::Cyclic => {
                    let total = self.current_duration + delta_duration;
                    if total > self.total_duration {
                        self.dirty = true;
                    }
                    self.current_elapsed_cycles += (total / self.total_duration) as usize;
                    self.current_duration = total % self.total_duration;
                }
            }

            self.dirty
        }
/// Adds the duration to the current timer and return whether or not the timer has ended or
/// done a cycle
Adds the duration to the current timer and return whether or not the timer has ended or
done a cycle
Adds the duration to the current timer and return whether or not the timer has ended or done a cycle
pub fn add_delta_duration(&mut self, delta_duration: f32) -> bool {
            self.dirty = false;
            if !self.running {
                return false;
            }
            match self.timer_type {
                TimerType::Manual => {
                    self.current_duration += delta_duration;
                    if self.current_duration >= self.total_duration {
                        self.running = false;
                        self.dirty = true;
                    }
                }
                TimerType::Cyclic => {
                    let total = self.current_duration + delta_duration;
                    if total > self.total_duration {
                        self.dirty = true;
                    }
                    self.current_elapsed_cycles += (total / self.total_duration) as usize;
                    self.current_duration = total % self.total_duration;
                }
            }
            self.dirty
        }
pub fn add_delta_duration ( & mut self , delta_duration : f32 ) -> bool { self . dirty = false ; if ! self . running { return false ; } match self . timer_type { TimerType :: Manual => { self . current_duration += delta_duration ; if self . current_duration >= self . total_duration { self . running = false ; self . dirty = true ; } } TimerType :: Cyclic => { let total = self . current_duration + delta_duration ; if total > self . total_duration { self . dirty = true ; } self . current_elapsed_cycles += ( total / self . total_duration ) as usize ; self . current_duration = total % self . total_duration ; } } self . dirty }
Adds the duration to the current timer and return whether or not the timer has ended or
done a cycle
Adds the duration to the current timer and return whether or not the timer has ended or done a cycle
&mut self
delta_duration
f32
&mut self
delta_duration
f32