generated from GarandPLG/rust-flake-template
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:
+3
-3
@@ -8,15 +8,15 @@ use crate::{
|
||||
use ratatui::layout::Rect;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub struct GameStates {
|
||||
pub struct GameStates<'a> {
|
||||
pub main_menu: MainMenuState,
|
||||
pub skirmish: SkirmishState,
|
||||
pub skirmish: SkirmishState<'a>,
|
||||
pub perk_decks: PerkDecksState,
|
||||
pub skills_config: SkillsConfigState,
|
||||
pub settings: SettingsState,
|
||||
}
|
||||
|
||||
impl GameStates {
|
||||
impl GameStates<'_> {
|
||||
pub fn new(args: &Cli, area: &Rect) -> Self {
|
||||
Self {
|
||||
main_menu: MainMenuState {
|
||||
|
||||
Reference in New Issue
Block a user