Skip to content

Commit

Permalink
Query on Trait-object doesn't work still.
Browse files Browse the repository at this point in the history
  • Loading branch information
CGMossa committed May 9, 2021
1 parent 343d023 commit 1c666c7
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
23 changes: 0 additions & 23 deletions examples/query_traits.rs

This file was deleted.

23 changes: 23 additions & 0 deletions examples/query_traits.rs_
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// TODO: This example showcases querying entities on trait implementations
// in bevy. Is this possible?

use bevy::prelude::*;
use std::fmt::Debug;

pub trait DebugComponen t: bevy::ecs::component::Component + Debug + ?Sized {}

fn main() {
let mut mini_world = World::new();
let entity_id = mini_world.spawn().insert(432).id();

fn my_system(query: Query<&dyn DebugComponent>) {
query.for_each(|x| {
// dbg!(x);
});
}

let mut some_stage = SystemStage::single(my_system.system());

some_stage.run(&mut mini_world);
}

0 comments on commit 1c666c7

Please sign in to comment.