generated from GarandPLG/rust-flake-template
Add tick thread and Skirmish state update
Introduce `AppEvent::Tick` and a background thread that emits timed events. `App` now handles `Tick` by calling a new `update` method, which advances the board and increments a `turn_counter` in `SkirmishState`. Add required imports, fields, and the `spawn_tick_thread` call in `main`.
This commit is contained in:
@@ -5,6 +5,7 @@ use std::sync::mpsc::Sender;
|
||||
pub enum AppEvent {
|
||||
Input(KeyEvent),
|
||||
Resize(u16, u16),
|
||||
Tick,
|
||||
}
|
||||
|
||||
/// Reads *all* crossterm events and forwards the ones we care about.
|
||||
|
||||
Reference in New Issue
Block a user