feat(countdown): rocket countdown (#45)
This commit is contained in:
@@ -207,10 +207,18 @@ impl<T> ClockState<T> {
|
||||
&self.mode
|
||||
}
|
||||
|
||||
pub fn run(&mut self) {
|
||||
self.mode = Mode::Tick
|
||||
}
|
||||
|
||||
pub fn is_running(&self) -> bool {
|
||||
self.mode == Mode::Tick
|
||||
}
|
||||
|
||||
pub fn is_initial(&self) -> bool {
|
||||
self.mode == Mode::Initial
|
||||
}
|
||||
|
||||
pub fn is_edit_mode(&self) -> bool {
|
||||
matches!(self.mode, Mode::Editable(_, _))
|
||||
}
|
||||
@@ -294,6 +302,10 @@ impl<T> ClockState<T> {
|
||||
self.update_format();
|
||||
}
|
||||
|
||||
pub fn is_done(&self) -> bool {
|
||||
self.mode == Mode::Done
|
||||
}
|
||||
|
||||
fn update_format(&mut self) {
|
||||
self.format = self.get_format();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user