refactor: compact

This commit is contained in:
🪞👃🪞 2024-06-07 16:51:30 +03:00
parent abee6cc2c8
commit 60627ac3e5
43 changed files with 923 additions and 780 deletions

View file

@ -89,8 +89,17 @@ impl Engine {
if event::poll(poll).is_ok() {
let event = event::read().unwrap();
let mut state = state.lock().unwrap();
if state.handle(&Event::Input(event)).is_err() {
break
match event {
crossterm::event::Event::Key(crossterm::event::KeyEvent {
code: KeyCode::Char('c'),
modifiers: KeyModifiers::CONTROL,
..
}) => {
state.exit()
},
_ => if state.handle(&crate::engine::Event::Input(event)).is_err() {
break
}
}
}
})