macro_rules! entity {
    ($component:expr $(,$components:expr)* $(,)?) => { ... };
    () => { ... };
}
Expand description

Creates an entity from the provided components.

This macro allows an enity to be defined without needing to manually create a heterogeneous list of components. Given an arbitrary number of components, this macro will arrange them into nested tuples forming a heterogeneous list.

Example

use brood::entity;

// Define components `Foo` and `Bar`.
struct Foo(u16);
struct Bar(f32);

// Define an entity containing an instance of `Foo` and `Bar`.
let my_entity = entity!(Foo(42), Bar(1.5));