Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
JackCrumpLeys committed Jul 20, 2023
1 parent 148bd34 commit a03a546
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 20 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions crates/core/src/energy_markers.rs

This file was deleted.

4 changes: 0 additions & 4 deletions crates/energy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 1 addition & 2 deletions crates/energy/src/battery.rs
Original file line number Diff line number Diff line change
@@ -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);
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/objects/src/health.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
16 changes: 10 additions & 6 deletions crates/spawner/src/destroyer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -54,13 +54,12 @@ fn find_dead(
}
}

fn destroy(mut commands: Commands, mut despawning: EventReader<Despawning>,) {
fn destroy(mut commands: Commands, mut despawning: EventReader<Despawning>) {
for entity in despawning.iter() {
commands.entity(entity.0).despawn_recursive();
}
}


#[derive(Debug)]
pub struct DespawnEventsPlugin<Q, T, F = ()>
where
Expand Down Expand Up @@ -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<TestComponent>>::default())
.add_plugin(DespawnEventsPlugin::<
&ComplexComponent,
ComplexComponent,
With<TestComponent>,
>::default())
.add_system(
despawn_all_test_system
.in_base_set(GameSet::Update)
Expand All @@ -208,7 +211,9 @@ mod tests {
EventReader<DespawnedComponents<&TestComponent, TestComponent>>,
>::new(&mut app.world);
let mut complex_events = SystemState::<
EventReader<DespawnedComponents<&ComplexComponent, ComplexComponent, With<TestComponent>>>,
EventReader<
DespawnedComponents<&ComplexComponent, ComplexComponent, With<TestComponent>>,
>,
>::new(&mut app.world);

trace!("---------- App update #1 ----------");
Expand Down Expand Up @@ -239,7 +244,6 @@ mod tests {
app.update();
trace!("-----------------------------------");


assert_eq!(
complex_events.get(&app.world).iter().next().unwrap().data,
ComplexComponent {
Expand Down

0 comments on commit a03a546

Please sign in to comment.