Skip to content
Snippets Groups Projects
Verified Commit 808322ec authored by Louis's avatar Louis :fire:
Browse files

Update to Bevy 0.13

parent 25e573cf
No related branches found
No related tags found
No related merge requests found
[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"
......@@ -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
hard_tabs = true
use_field_init_shorthand = true
use_try_shorthand = true
\ No newline at end of file
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment