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 .join
ing on Entities
, you will need to do it like this:
use specs::prelude::*;
for (e, pos) in (&entities, &positions).join() {
// Do something
}
Aliased Type§
struct Entities<'a> { /* private fields */ }
Trait Implementations§
source§impl<'a, T, F> SystemData<'a> for Read<'a, T, F>where
T: Resource,
F: SetupHandler<T>,
impl<'a, T, F> SystemData<'a> for Read<'a, T, F>where T: Resource, F: SetupHandler<T>,
source§fn fetch(world: &'a World) -> Read<'a, T, F>
fn fetch(world: &'a World) -> Read<'a, T, F>
Fetches the system data from
World
. Note that this is only specified
for one concrete lifetime 'a
, you need to implement the
SystemData
trait for every possible lifetime.