diff --git a/Cargo.toml b/Cargo.toml index 7746f28204047b0df2fb37822bd0ed4aa68b6db8..47584bbc2621a57445f7f30dbf753c6a535905da 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "micro_bevy_world_utils" -version = "0.3.0" +version = "0.4.0" edition = "2021" license = "Apache-2.0" description = "Handy, reusable utilities for working with direct world access in a Bevy exclusive system" @@ -11,5 +11,5 @@ repository = "https://lab.lcr.gr/microhacks/micro-bevy-world-utils" [dependencies] -bevy_ecs = "0.11.0" -bevy_hierarchy = "0.11.0" +bevy_ecs = "0.13" +bevy_hierarchy = "0.13" diff --git a/README.md b/README.md index 5e74b6ba151e9740efc262e5190a25243f2c41f0..ec5b1ce013f7afa706ba40c2302c2b65057b0f2b 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,7 @@ the given entities, the result will be `None` | world_utiles ver | bevy ver | |------------------|----------| +| 0.4 | 0.13 | | 0.3 | 0.11 | | 0.2 | 0.10 | | 0.1 | 0.9 | \ No newline at end of file diff --git a/rustfmt.toml b/rustfmt.toml new file mode 100644 index 0000000000000000000000000000000000000000..2b6f66e87d12dad0d933b81de57925300dd3a3fe --- /dev/null +++ b/rustfmt.toml @@ -0,0 +1,3 @@ +hard_tabs = true +use_field_init_shorthand = true +use_try_shorthand = true \ No newline at end of file diff --git a/src/lib.rs b/src/lib.rs index 01f0cc771e7f7d5bd5de986ae36e3236b04589d0..cc11f6aeb47867c6143b208938596c5c24f6a16e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -30,10 +30,10 @@ //! - `get_left_right_any_parent`: Match entities to the left and right components, but return the _parent_ entity of the right entity //! use bevy_ecs::{ - component::Component, + component::Component, entity::Entity, event::EventWriter, - query::{With, ReadOnlyWorldQuery}, + query::{QueryFilter, With}, system::{Query, SystemState}, world::World, }; @@ -44,8 +44,8 @@ pub type Right = Entity; pub type SortedEntities = (Left, Right); fn inner_get_left_right_entities< - LeftSide: ReadOnlyWorldQuery + 'static, - RightSide: ReadOnlyWorldQuery + 'static, + LeftSide: QueryFilter + 'static, + RightSide: QueryFilter + 'static, >( world: &mut World, first: &Entity, @@ -64,9 +64,9 @@ fn inner_get_left_right_entities< } fn inner_get_left_right_parent_entities< - LeftSide: ReadOnlyWorldQuery + 'static, - RightSide: ReadOnlyWorldQuery + 'static, - ParentSide: ReadOnlyWorldQuery + 'static, + LeftSide: QueryFilter + 'static, + RightSide: QueryFilter + 'static, + ParentSide: QueryFilter + 'static, >( world: &mut World, first: &Entity, @@ -98,10 +98,10 @@ fn inner_get_left_right_parent_entities< } fn inner_get_left_parent_right_parent_entities< - LeftSide: ReadOnlyWorldQuery + 'static, - LeftParent: ReadOnlyWorldQuery + 'static, - RightSide: ReadOnlyWorldQuery + 'static, - RightParent: ReadOnlyWorldQuery + 'static, + LeftSide: QueryFilter + 'static, + LeftParent: QueryFilter + 'static, + RightSide: QueryFilter + 'static, + RightParent: QueryFilter + 'static, >( world: &mut World, first: &Entity, @@ -240,7 +240,10 @@ pub fn get_any_left_parent_any_right_parent_entities< /// send_event(world, MyEventType { message: 1234 }); /// } /// ``` -pub fn send_event<Event: bevy_ecs::event::Event + Sync + Send + 'static>(world: &mut World, event: Event) { +pub fn send_event<Event: bevy_ecs::event::Event + Sync + Send + 'static>( + world: &mut World, + event: Event, +) { SystemState::<EventWriter<Event>>::new(world) .get_mut(world) .send(event);