Add lifetime parameter and MarkedCells struct

Refactor App, GameStates, SkirmishState and BoardState to carry a
generic
lifetime `'a`. Introduce a new `MarkedCells` type that holds marking
state
and selected unit, replacing the previous `marking_cells` flag and raw
deque. Update related methods, keybindings, view implementations and
module exports to use the new structures.
This commit is contained in:
GarandPLG committed 2026-05-06 21:39:53 +02:00
1 parent b66c1d8e25
commit cd1822d05e
11 files changed
+78 -38

No files matched your search

+4 -1
View File
@@ -56,7 +56,10 @@ pub fn skirmish_main_area_layout(area: Rect, side_panel: bool) -> [Rect; 2] {
}
pub fn skirmish_view(app: &App, area: Rect, buf: &mut Buffer) {
let Some(states) = app.states() else { return };
let Some(states) = app.states_ref() else {
return;
};
let board: &BoardState = &states.skirmish.board;
let [title_area, main_area, keybindings_area] = skirmish_layout(area);