define_multi_property

Macro define_multi_property 

Source
macro_rules! define_multi_property {
    (
            ( $($dependency:ident),+ ),
            $entity:ident
        ) => { ... };
}
Expand description

Defines a derived property consisting of a (named) tuple of other properties. The primary use case is for indexing and querying properties jointly.

The index subsystem is smart enough to reuse indexes for multi-properties that are equivalent up to reordering of the component properties. The querying subsystem is able to detect when its multiple component properties are equivalent to an indexed multi-property and use that index to perform the query.

Components must be the underlying property type, not a type alias (see issue #843):

use ixa::{define_entity, define_property, define_multi_property};
define_entity!(Person);
define_property!(struct Age(u8), Person, default_const = Age(0));
define_property!(struct Height(u8), Person, default_const = Height(0));
type Years = Age;
define_multi_property!((Years, Height), Person);