[][src]Macro nano_ecs::system

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

Declares and executes a system.

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

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

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

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