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:
2026-05-06 21:39:53 +02:00
parent b66c1d8e25
commit cd1822d05e
11 changed files with 78 additions and 38 deletions
+3 -3
View File
@@ -1,15 +1,15 @@
use crate::app::states::skirmish_states::BoardState;
#[derive(Debug, Clone, PartialEq)]
pub struct SkirmishState {
pub struct SkirmishState<'a> {
pub id: usize,
pub name: &'static str,
pub board: BoardState,
pub board: BoardState<'a>,
pub side_panel: bool,
pub turn_counter: u64,
}
impl SkirmishState {
impl SkirmishState<'_> {
pub fn tick_update(&mut self) {
// self.board.advance_turn();