diff --git a/Cargo.lock b/Cargo.lock index c98df741d..7b395d568 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2239,7 +2239,6 @@ name = "de_energy" version = "0.1.0-dev" dependencies = [ "bevy", - "de_core", ] [[package]] diff --git a/crates/core/src/energy_markers.rs b/crates/core/src/energy_markers.rs deleted file mode 100644 index 386f1bef2..000000000 --- a/crates/core/src/energy_markers.rs +++ /dev/null @@ -1,6 +0,0 @@ -//! This module was created to solve a problem with circular dependencies. It -//! contains a couple marker components that are used from other -//! modules. -//! -//! The problem is that `de_spawner` depends on `de_energy` for the -//! `Battery` component, but `de_energy` depends on `de_spawner` for the diff --git a/crates/energy/Cargo.toml b/crates/energy/Cargo.toml index 613d427e6..f7141b623 100644 --- a/crates/energy/Cargo.toml +++ b/crates/energy/Cargo.toml @@ -14,8 +14,4 @@ categories.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -# DE -de_core.workspace = true - -# Other bevy.workspace = true diff --git a/crates/energy/src/battery.rs b/crates/energy/src/battery.rs index 9a9509c23..03e693386 100644 --- a/crates/energy/src/battery.rs +++ b/crates/energy/src/battery.rs @@ -1,11 +1,10 @@ use bevy::prelude::*; -use de_core::baseset::GameSet; pub(crate) struct BatteryPlugin; impl Plugin for BatteryPlugin { fn build(&self, app: &mut App) { - app.add_system(discharge_battery.in_base_set(GameSet::Update)); + app.add_system(discharge_battery); } } diff --git a/crates/objects/src/health.rs b/crates/objects/src/health.rs index 02dc182ef..49a89d07a 100644 --- a/crates/objects/src/health.rs +++ b/crates/objects/src/health.rs @@ -48,7 +48,7 @@ impl Health { /// /// * `health` - maximum & current health. Must be a positive finite /// number. - pub const fn full(health: f32) -> Self { + const fn full(health: f32) -> Self { Self { max: health, health, diff --git a/crates/spawner/src/destroyer.rs b/crates/spawner/src/destroyer.rs index 80549439f..1eb86f092 100644 --- a/crates/spawner/src/destroyer.rs +++ b/crates/spawner/src/destroyer.rs @@ -33,7 +33,7 @@ impl Plugin for DiscoverDeadPlugin { enum DestroyerSet { FindDead, SendData, - DestroyDead + DestroyDead, } // Find all entities with low health and mark them for despawning @@ -54,13 +54,12 @@ fn find_dead( } } -fn destroy(mut commands: Commands, mut despawning: EventReader,) { +fn destroy(mut commands: Commands, mut despawning: EventReader) { for entity in despawning.iter() { commands.entity(entity.0).despawn_recursive(); } } - #[derive(Debug)] pub struct DespawnEventsPlugin where @@ -189,7 +188,11 @@ mod tests { trace!("Simple entity spawned -> {:?}", simple_entity); app.add_plugin(DespawnEventsPlugin::<&TestComponent, TestComponent>::default()) - .add_plugin(DespawnEventsPlugin::<&ComplexComponent, ComplexComponent, With>::default()) + .add_plugin(DespawnEventsPlugin::< + &ComplexComponent, + ComplexComponent, + With, + >::default()) .add_system( despawn_all_test_system .in_base_set(GameSet::Update) @@ -208,7 +211,9 @@ mod tests { EventReader>, >::new(&mut app.world); let mut complex_events = SystemState::< - EventReader>>, + EventReader< + DespawnedComponents<&ComplexComponent, ComplexComponent, With>, + >, >::new(&mut app.world); trace!("---------- App update #1 ----------"); @@ -239,7 +244,6 @@ mod tests { app.update(); trace!("-----------------------------------"); - assert_eq!( complex_events.get(&app.world).iter().next().unwrap().data, ComplexComponent {