Expand description
Prelude module
Contains all of the most common traits, structures,
Structs§
- BitSet
- A
BitSetis a simple set designed to track which indices are placed into it. - Change
Set - Change set that can be collected from an iterator, and joined on for easy application to components.
- Dense
VecStorage - Dense vector storage. Has a redirection 2-way table between entities and components, allowing to leave no gaps within the data.
- Dispatcher
- The dispatcher struct, allowing systems to be executed in parallel.
- Dispatcher
Builder - Builder for the
Dispatcher. - Entity
Entitytype, as seen by the user.- Entity
Builder - The entity builder, allowing to build an entity together with its components.
- Flagged
Storage - Wrapper storage that tracks modifications, insertions, and removals of components
through an
EventChannel. - Hash
MapStorage - HashMap-based storage. Best suited for rare components.
- Lazy
Update - Lazy updates can be used for world updates
that need to borrow a lot of resources
and as such should better be done at the end.
They work lazily in the sense that they are
dispatched when calling
world.maintain(). - Null
Storage - A null storage type, used for cases where the component doesn’t contain any data and instead works as a simple flag.
- Read
- Allows to fetch a resource in a system immutably.
- Reader
Id - A reader ID which represents a subscription to the events pushed to the
EventChannel. - Resources
- A resource container, which provides methods to access to the contained resources.
- Static
Accessor - The static accessor that is used for
SystemData. - Storage
- A wrapper around the masked storage and the generations vector.
Can be used for safe lookup of components, insertions and removes.
This is what
World::read/writefetches for the user. - VecStorage
- Vector storage. Uses a simple
Vec. Supposed to have maximum performance for the components mostly present in entities. - World
- The
Worldstruct contains the component storages and other resources. - Write
- Allows to fetch a resource in a system mutably.
Enums§
- Component
Event - Component storage events received from a
FlaggedStorageor any storage that implementsTracked.
Traits§
- Accessor
- A trait for accessing read/write multiple resources from a system. This can be used to create dynamic systems that don’t specify what they fetch at compile-time.
- Builder
- A common trait for
EntityBuilderandLazyBuilder, allowing either to be used. Entity is definitely alive, but the components may or may not exist before a call toWorld::maintain. - Component
- Abstract component type. Doesn’t have to be Copy or even Clone.
- Join
- The purpose of the
Jointrait is to provide a way to access multiple storages at the same time with the merged bit set. - RunNow
- Trait for fetching data and running systems. Automatically implemented for systems.
- System
- A
System, executed with a set of requiredResources. - System
Data - A static system data that can specify its dependencies at statically (at compile-time).
Most system data is a
SystemData, theDynamicSystemDatatype is only needed for very special setups. - Tracked
UnprotectedStorages that track modifications, insertions, and removals of components.
Type Aliases§
- Entities
- A wrapper for a read
Entitiesresource. Note that this is justRead<Entities>, so you can easily use it in your system: - Read
Expect - Allows to fetch a resource in a system immutably.
This will panic if the resource does not exist.
Usage of
ReadorOption<Read>is therefore recommended. - Read
Storage - A storage with read access.
- Write
Expect - Allows to fetch a resource in a system mutably.
This will panic if the resource does not exist.
Usage of
WriteorOption<Write>is therefore recommended. - Write
Storage - A storage with read and write access.