Skip to content

Commit

Permalink
changed update function to take reference to systems
Browse files Browse the repository at this point in the history
  • Loading branch information
DynamicGoose committed Jul 9, 2024
1 parent 3f1fe9b commit 4e0232d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "magma_ecs"
version = "0.1.0-alpha.4"
version = "0.1.0-alpha.5"
edition = "2021"
license = "MIT"
description = "Entity-Component-System for the Magma3D game engine"
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ impl World {
/// This takes a [`Vec`] of references to functions that take a reference to [`World`].
/// It runs all of the supplied functions in parallel once on the [`World`].
pub fn update(&self, systems: Vec<fn(&Self)>) {
pub fn update(&self, systems: &Vec<fn(&Self)>) {
systems.par_iter().for_each(|s| s(self));
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/world.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use magma_ecs::World;
fn update() {
let world = World::new();
world.register_component::<u32>();
world.update(vec![create_u32_entity, create_u32_entity]);
world.update(&vec![create_u32_entity, create_u32_entity]);

let entities = world.entities_read();
let query = entities.query().with_component::<u32>().unwrap().run();
Expand Down

0 comments on commit 4e0232d

Please sign in to comment.