generated from GarandPLG/rust-flake-template
Add rustfmt configuration and reformat code
- Document new Rust formatting standards in AGENTS, CODE_MAP, and PROGRESS. - Add rustfmt.toml with style 2024, 2‑space indents, 100‑char width, LF endings. - Apply consistent 2‑space indentation and ordering across source files. - Minor clean‑up of imports and whitespace to match the new style.
This commit is contained in:
1 parent
9e09aaf75e
commit
c4313b4117
60 files changed
+3632
-3610
No files matched your search
+51
-51
@@ -1,62 +1,62 @@
|
||||
use crate::{
|
||||
app::states::{
|
||||
MainMenuState, PerkDecksState, SettingsState, SkillsConfigState, SkirmishState,
|
||||
skirmish_states::BoardState,
|
||||
},
|
||||
cli::Cli,
|
||||
app::states::{
|
||||
MainMenuState, PerkDecksState, SettingsState, SkillsConfigState, SkirmishState,
|
||||
skirmish_states::BoardState,
|
||||
},
|
||||
cli::Cli,
|
||||
};
|
||||
use ratatui::layout::Rect;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub struct GameStates {
|
||||
pub main_menu: MainMenuState,
|
||||
pub skirmish: SkirmishState,
|
||||
pub perk_decks: PerkDecksState,
|
||||
pub skills_config: SkillsConfigState,
|
||||
pub settings: SettingsState,
|
||||
pub main_menu: MainMenuState,
|
||||
pub skirmish: SkirmishState,
|
||||
pub perk_decks: PerkDecksState,
|
||||
pub skills_config: SkillsConfigState,
|
||||
pub settings: SettingsState,
|
||||
}
|
||||
|
||||
impl GameStates {
|
||||
pub fn new(args: &Cli, area: &Rect) -> Self {
|
||||
Self {
|
||||
main_menu: MainMenuState {
|
||||
id: 0,
|
||||
name: "Main Menu",
|
||||
selected_view: 1,
|
||||
},
|
||||
skirmish: SkirmishState {
|
||||
id: 1,
|
||||
name: "Skirmish",
|
||||
board: BoardState::new(
|
||||
area,
|
||||
args.map_width as usize,
|
||||
args.map_height as usize,
|
||||
args.zoom_level,
|
||||
false,
|
||||
),
|
||||
side_panel: false,
|
||||
turn_counter: 0,
|
||||
},
|
||||
perk_decks: PerkDecksState {
|
||||
id: 2,
|
||||
name: "Perk Decks",
|
||||
selected_perk_deck: 0,
|
||||
},
|
||||
skills_config: SkillsConfigState {
|
||||
id: 3,
|
||||
name: "Skills Config",
|
||||
selected_skill: 0,
|
||||
},
|
||||
settings: SettingsState {
|
||||
username: args.username.clone(),
|
||||
game_mode: args.game_mode.clone(),
|
||||
perk_deck: args.perk_deck.clone(),
|
||||
starting_wood: args.starting_wood.clone(),
|
||||
starting_iron: args.starting_iron.clone(),
|
||||
supply_limit: args.supply_limit.clone(),
|
||||
xp_modifier: args.xp_modifier.clone(),
|
||||
skill_points_limit: args.skill_points_limit.clone(),
|
||||
},
|
||||
}
|
||||
pub fn new(args: &Cli, area: &Rect) -> Self {
|
||||
Self {
|
||||
main_menu: MainMenuState {
|
||||
id: 0,
|
||||
name: "Main Menu",
|
||||
selected_view: 1,
|
||||
},
|
||||
skirmish: SkirmishState {
|
||||
id: 1,
|
||||
name: "Skirmish",
|
||||
board: BoardState::new(
|
||||
area,
|
||||
args.map_width as usize,
|
||||
args.map_height as usize,
|
||||
args.zoom_level,
|
||||
false,
|
||||
),
|
||||
side_panel: false,
|
||||
turn_counter: 0,
|
||||
},
|
||||
perk_decks: PerkDecksState {
|
||||
id: 2,
|
||||
name: "Perk Decks",
|
||||
selected_perk_deck: 0,
|
||||
},
|
||||
skills_config: SkillsConfigState {
|
||||
id: 3,
|
||||
name: "Skills Config",
|
||||
selected_skill: 0,
|
||||
},
|
||||
settings: SettingsState {
|
||||
username: args.username.clone(),
|
||||
game_mode: args.game_mode.clone(),
|
||||
perk_deck: args.perk_deck.clone(),
|
||||
starting_wood: args.starting_wood.clone(),
|
||||
starting_iron: args.starting_iron.clone(),
|
||||
supply_limit: args.supply_limit.clone(),
|
||||
xp_modifier: args.xp_modifier.clone(),
|
||||
skill_points_limit: args.skill_points_limit.clone(),
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user