From 63f2bb6b696bfde5fdd4818e440dce93492be9a5 Mon Sep 17 00:00:00 2001 From: Vinermy Date: Thu, 1 Aug 2024 22:44:21 +0700 Subject: [PATCH] Fixed project not building before ECS rewrite --- src/app.rs | 11 +---------- src/components/ship_module_designer.rs | 4 ++-- src/game/game_state.rs | 16 ++++++++-------- src/game/mod.rs | 2 +- src/game/shipbuilding/ship_module_manager.rs | 14 +++++++------- 5 files changed, 19 insertions(+), 28 deletions(-) diff --git a/src/app.rs b/src/app.rs index 033552d..53b436e 100644 --- a/src/app.rs +++ b/src/app.rs @@ -25,6 +25,7 @@ use crate::game::celestial_bodies::Displayable; use crate::game::colony::building::BuildingType; use crate::game::colony::colony::Colony; use crate::game::game_state::GameState; +use crate::game::shipbuilding::ship_module::ShipModule; use crate::mode::Mode::{SelectingBodyInSystemTree, SelectingResearchField}; use crate::tabs::Tabs; @@ -325,16 +326,6 @@ impl App { ) )?; }, - Action::ScheduleLoadShipModulesForType(ref module_type_name) => { - let module_type = self.state.get_ship_module_type_by_name(module_type_name); - let modules: Vec = self.state.get_ship_modules_by_type(module_type); - let data: Vec<(String, Color)> = modules.iter().map( - |m| { - (m.get_name(), m.get_menu_color()) - } - ); - action_tx.send(Action::LoadShipModulesForType(data))?; - } _ => {}, } for component in self.components.iter_mut() diff --git a/src/components/ship_module_designer.rs b/src/components/ship_module_designer.rs index 25d7344..9938b8d 100644 --- a/src/components/ship_module_designer.rs +++ b/src/components/ship_module_designer.rs @@ -50,8 +50,8 @@ impl Component for ShipModuleDesigner { } } Action::ContinueSelecting => { - self.state = WidgetState::SelectingModule - return Ok(Some(Action::)) + self.state = WidgetState::SelectingModule; + return Ok(None) } Action::SelectNext => { match self.state { diff --git a/src/game/game_state.rs b/src/game/game_state.rs index 4f1e978..8f29820 100644 --- a/src/game/game_state.rs +++ b/src/game/game_state.rs @@ -6,7 +6,7 @@ use crate::game::celestial_bodies::solar_system::SolarSystem; use crate::game::colony::building::BuildingType; use crate::game::colony::colony::Colony; use crate::game::research::research_manager::ResearchManager; -use crate::game::shipbuilding::ship_module::{ShipModule, ShipModuleType}; +use crate::game::shipbuilding::ship_module::ShipModuleType; use crate::game::shipbuilding::ship_module_manager::ShipModuleManager; pub struct GameState { @@ -130,11 +130,11 @@ impl GameState { self.ship_module_manager.get_ship_module_types() } - pub fn get_ship_module_type_by_name(&self, name: String) -> ShipModuleType { - self.ship_module_manager.get_ship_module_type_by_name(name) - } - - pub fn get_ship_modules_by_type(&self, module_type: ShipModuleType) -> Vec { - self.ship_module_manager.get_ship_modules_by_type(module_type) - } + // pub fn get_ship_module_type_by_name(&self, name: String) -> ShipModuleType { + // self.ship_module_manager.get_ship_module_type_by_name(name) + // } + // + // pub fn get_ship_modules_by_type(&self, module_type: ShipModuleType) -> Vec { + // self.ship_module_manager.get_ship_modules_by_type(module_type) + // } } diff --git a/src/game/mod.rs b/src/game/mod.rs index e5d920a..c538bb4 100644 --- a/src/game/mod.rs +++ b/src/game/mod.rs @@ -4,4 +4,4 @@ pub mod research; pub mod game_state; pub mod colony; mod resource; -mod shipbuilding; +pub mod shipbuilding; diff --git a/src/game/shipbuilding/ship_module_manager.rs b/src/game/shipbuilding/ship_module_manager.rs index 37586ca..c98b3a6 100644 --- a/src/game/shipbuilding/ship_module_manager.rs +++ b/src/game/shipbuilding/ship_module_manager.rs @@ -26,11 +26,11 @@ impl ShipModuleManager { ShipModuleType::from(name) } - pub fn get_ship_modules_by_type(&self, module_type: ShipModuleType) -> Vec { - let modules = match module_type { - ShipModuleType::SublightThruster => { self.sublight_engines.clone() } - }; - - modules - } + // pub fn get_ship_modules_by_type(&self, module_type: ShipModuleType) -> Vec { + // let modules = match module_type { + // ShipModuleType::SublightThruster => { self.sublight_engines.clone() } + // }; + // + // modules + // } } \ No newline at end of file