Struct specs::World [] [src]

pub struct World<C = ()> where C: PartialEq + Eq + Hash { /* fields omitted */ }

The World struct contains all the data, which is entities and their components. All methods are supposed to be valid for any context they are available in. The type parameter C is for component identification in addition of their types.

Methods

impl<C> World<C> where C: PartialEq + Eq + Hash
[src]

Creates a new empty World with the associated component id.

Registers a new component type and id pair.

Unregisters a component type and id pair.

Locks a component's storage for reading.

Locks a component's storage for writing.

Returns the entity iterator.

Returns the entity creation iterator. Can be used to create many empty entities at once without paying the locking overhead.

Creates a new entity instantly, locking the generations data.

Deletes a new entity instantly, locking the generations data.

Creates a new entity dynamically.

Creates a new entity dynamically, and starts building it.

Deletes an entity dynamically.

Returns true if the given Entity is alive.

Merges in the appendix, recording all the dynamically created and deleted entities into the persistent generations vector. Also removes all the abandoned components.

add a new resource to the world

check to see if a resource is present

get read-only access to an resource

get read-write access to a resource

impl World<()>
[src]

Creates a new empty World.

Registers a new component type.

Unregisters a component type.

Locks a component's storage for reading.

Locks a component's storage for writing.