Type Definition specs::Entities [] [src]

type Entities<'a> = Fetch<'a, EntitiesRes>;

A wrapper for a fetched Entities resource. Note that this is just Fetch<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 Entities you will need to first dereference Entities / Fetch<EntitiesRes> to get the underlying EntitiesRes, then you will need to re-reference it since only the referenced Entities has an implementation for Join. (in code: &*entities):

use specs::{Entities, Join};

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