examples/systems/
system_custom_phases_no_builtin.rs1use crate::z_ignore_test_common::*;
2
3use flecs_ecs::prelude::*;
4fn sys(mut it: TableIter) {
10 while it.next() {
11 println!("system {}", it.system().name());
12 }
13}
14
15fn main() {
16 let world = World::new();
17
18 let update = world.entity().add(id::<flecs::pipeline::Phase>());
23
24 let physics = world
25 .entity()
26 .add(id::<flecs::pipeline::Phase>())
27 .depends_on(update);
28
29 let collisions = world
30 .entity()
31 .add(id::<flecs::pipeline::Phase>())
32 .depends_on(physics);
33
34 world
36 .system_named::<()>("CollisionSystem")
37 .kind(collisions)
38 .run(sys);
39
40 world
41 .system_named::<()>("PhysicsSystem")
42 .kind(physics)
43 .run(sys);
44
45 world.system_named::<()>("GameSystem").kind(update).run(sys);
46
47 world.progress();
49
50 }
55
56#[cfg(feature = "flecs_nightly_tests")]
57#[test]
58fn test() {
59 let output_capture = OutputCapture::capture().unwrap();
60 main();
61 output_capture.test("system_custom_phases_no_builtin".to_string());
62}