generated from GarandPLG/rust-flake-template
Initialize skirmish board and refactor states
- Create `GameStates` from a `&Cli` and initialize the skirmish board in `App::new`. - Move map dimensions to `SkirmishState` and add a `board_cells` vector populated by `CellWidget`s. - Refactor `SettingsState` to store only user‑specific settings (fields are cloned). - Update `BoardWidget` to hold a reference to the cell vector and use the new dimensions. - Adjust CLI defaults: map width to 50 and map height to 25.
This commit is contained in:
+4
-1
@@ -25,10 +25,13 @@ pub struct App {
|
||||
|
||||
impl App {
|
||||
pub fn new(args: Cli) -> Self {
|
||||
let mut states: GameStates = GameStates::new(&args);
|
||||
states.skirmish.init_board();
|
||||
|
||||
Self {
|
||||
exit: false,
|
||||
view: args.view,
|
||||
states: GameStates::new(args),
|
||||
states,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user