Skip to content

Commit

Permalink
core: remove redundant system set
Browse files Browse the repository at this point in the history
  • Loading branch information
philiplinden committed Jan 12, 2025
1 parent 2ac04de commit 2f671df
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 29 deletions.
21 changes: 0 additions & 21 deletions crates/yahs/src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,6 @@ impl Plugin for CorePhysicsPlugin {
time::TimeScalePlugin,
));
app.init_state::<SimState>();
app.configure_sets(
Update,
(
SimulationUpdateOrder::First,
SimulationUpdateOrder::IdealGas,
SimulationUpdateOrder::MeshVolumes,
SimulationUpdateOrder::Forces,
SimulationUpdateOrder::Last,
).chain()
.before(PhysicsSet::Prepare)
.run_if(in_state(SimState::Running)),
);
}
}

Expand All @@ -52,12 +40,3 @@ pub enum SimState {
Running,
Faulted,
}

#[derive(SystemSet, Debug, Clone, PartialEq, Eq, Hash)]
pub enum SimulationUpdateOrder {
First,
IdealGas,
MeshVolumes,
Forces,
Last,
}
2 changes: 1 addition & 1 deletion crates/yahs/src/forces/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub use body::{Buoyancy, Weight};
use crate::{
gas::Atmosphere,
vehicle::Balloon,
core::{SimState, SimulationUpdateOrder},
core::SimState,
thermodynamics::{Density, Volume},
};
pub struct ForcesPlugin;
Expand Down
4 changes: 2 additions & 2 deletions crates/yahs/src/gas/atmosphere.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use bevy::prelude::*;
use super::{ideal_gas_density, GasSpecies};
use crate::{
thermodynamics::{Density, Pressure, Temperature},
core::{SimulationUpdateOrder, SimState},
core::SimState,
vehicle::Balloon,
};

Expand All @@ -21,7 +21,7 @@ impl Plugin for AtmospherePlugin {
app.insert_resource(Atmosphere);
app.add_systems(
Update,
pause_on_out_of_bounds.in_set(SimulationUpdateOrder::First),
pause_on_out_of_bounds,
);
}
}
Expand Down
2 changes: 0 additions & 2 deletions crates/yahs/src/gas/ideal_gas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use bevy::prelude::*;

use crate::{
gas::Atmosphere,
core::SimulationUpdateOrder,
thermodynamics::{
Density, MolarMass, Pressure, Temperature, Volume, AVOGADRO_CONSTANT, BOLTZMANN_CONSTANT,
},
Expand All @@ -24,7 +23,6 @@ impl Plugin for IdealGasPlugin {
update_ideal_gas_from_atmosphere,
sync_ideal_gas_with_physics_mass,
)
.in_set(SimulationUpdateOrder::IdealGas),
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/yahs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ mod time;
mod trajectory;
mod spawn;
pub mod prelude {
pub use crate::core::{SimulatorPlugins, SimState, SimulationUpdateOrder};
pub use crate::core::{SimulatorPlugins, SimState};
pub use crate::thermodynamics::{Density, Pressure, Temperature, Volume, MolarMass};
pub use crate::forces::{Weight, Buoyancy, Drag, Force};
pub use crate::vehicle::{Balloon, BalloonBundle, BalloonMaterial, BalloonPlugin};
Expand Down
3 changes: 1 addition & 2 deletions crates/yahs/src/vehicle/balloon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use bevy::prelude::*;
use crate::{
gas::IdealGas,
thermodynamics::{sphere_radius_from_volume, Volume},
core::SimulationUpdateOrder,
forces::{Weight, Drag, Buoyancy},
};

Expand All @@ -20,7 +19,7 @@ impl Plugin for BalloonPlugin {

app.add_systems(
Update,
update_balloon_from_gas.in_set(SimulationUpdateOrder::MeshVolumes),
update_balloon_from_gas,
);
}
}
Expand Down

0 comments on commit 2f671df

Please sign in to comment.