[][src]Macro nano_ecs::system

macro_rules! system {
    ($world:ident, $(filter: |$filter_id:ident| $filter:expr ;)* |$($n:ident: $x:ty),*| $e:expr) => { ... };
    ($world:ident, $iter:expr, $(filter: |$filter_id:ident| $filter:expr ;)* |$($n:ident: $x:ty),*| $e:expr) => { ... };
}

Declares and executes a system.

Example: system!(world, |pos: &mut Position| {...});

You can also specify the range of entities:

system!(world, 0..4, |pos: &mut Position| {...});

system!(world, world.all(), |pos: &mut Position| {...});

One or more filters can be added using the world object:

system!(world, filter: |n| world.has_component::<Velocity>(); |pos: &mut Position| {...})

Pre-processes a mask map from component index to entity slice. This is the same for any signature, no matter which order arguments are preserved.

Warning! This is unsafe to call nested when accessing same entities more than one.