Type Definition specs::prelude::Entities

source · []
pub type Entities<'a> = Read<'a, EntitiesRes>;
Expand description

A wrapper for a read Entities resource. Note that this is just Read<Entities>, so you can easily use it in your system:

type SystemData = (Entities<'a> /* ... */,);

Please note that you should call World::maintain after creating / deleting entities with this resource.

When .joining on Entities, you will need to do it like this:

use specs::prelude::*;

for (e, pos) in (&entities, &positions).join() {
    // Do something
}