update todo list, print real time taken when level is completed

This commit is contained in:
Crispy 2024-12-08 12:10:14 +01:00
parent 78027aaaa0
commit dc9411cf9d
2 changed files with 18 additions and 13 deletions

View file

@ -64,6 +64,7 @@ pub struct Editor {
blueprint_scroll: usize,
step_time: u128,
max_step_time:u128,
start_time: Instant
}
#[derive(Debug, PartialEq)]
@ -141,6 +142,7 @@ impl Editor {
blueprint_scroll: 0,
step_time: 0,
max_step_time: 0,
start_time: Instant::now(),
}
}
@ -166,6 +168,7 @@ impl Editor {
fn start_sim(&mut self) {
self.max_step_time = 0;
self.start_time = Instant::now();
self.machine.reset();
self.machine.set_board(self.source_board.clone());
}
@ -193,6 +196,7 @@ impl Editor {
&& self.complete_popup == Popup::Start
{
self.complete_popup = Popup::Visible;
println!("completed in {:?}", self.start_time.elapsed());
self.exit_state = ExitState::Save;
self.sim_state = SimState::Stepping;
self.score = Some(Score {