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.

Does nothing if the type and id pair was already registered.

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 a resource.

Get read-write access to a resource.

impl World<()>
[src]

Creates a new empty World.

Registers a new component type.

Does nothing if the component type was already registered.

Unregisters a component type.

impl World<()>
[src]

Request a read ticket for a particular component storage.

Request a write ticket for a particular component storage.

Get read-only access to a resource.

Get read-write access to a resource.