484#include "EntityManager.inl"
#define CE_FLAGS_OPERATORS(Enum)
Defines global operators for a Flags<Enum, Storage> implementation.
Definition Flags.hpp:216
#define CE_SCRIPT_EXPORT(...)
The CE_SCRIPT_EXPORT macro marks a class or method as exportable and available in scripting environme...
Definition Macros.hpp:247
The component store class is responsible for managing and organizing component data storage in memory...
Definition ComponentStore.hpp:28
A value type that can hold any alongside it's type information.
Definition Box.hpp:40
Represents a reflected property from metadata defined by the class.
Definition Class.hpp:176
A object that manages a set of components masks.
Definition Component.hpp:238
A type-safe component store implementation.
Definition ComponentStore.hpp:135
A type that describes and provides type-erased operations on a component.
Definition Component.hpp:456
Definition ActionManager.hpp:26
Definition EventManager.hpp:24
The base entity class.
Definition Entity.hpp:41
Definition EntityID.hpp:76
The query executor is responsible for iterating over entities and filtering them based on a given pre...
Definition EntityManager.hpp:368
QueryExecutor(Predicate &&predicate)
Creates a new query executor instance.
P Predicate
The predicate type.
Definition EntityManager.hpp:371
Generator< const Entity > operator()(const EntityManager &entityManager) const noexcept
Executes the query.
Predicate mPredicate
The predicate to filter selected entities.
Definition EntityManager.hpp:375
Definition EntityManager.hpp:49
HashMap< ComponentMask, Vector< AbstractComponentListener * > > mComponentListeners
A set of listeners for component changes.
Definition EntityManager.hpp:71
ComponentMaskSet mComponentMasks
A vector of component masks for every known entity, indexed by their entity indexes.
Definition EntityManager.hpp:59
Vector< UPtr< AbstractComponentStore > > mComponentStores
A vector containing all component stores indexed by their component IDs.
Definition EntityManager.hpp:55
Entity create(const Entity &parent=nullEntity, String name={})
Creates a new entity.
Map< EntityIndex, EntityChangeSet > mDirtyEntities
A list of entities whose components have been recently dirtied.
Definition EntityManager.hpp:74
static const Entity nullEntity
Definition EntityManager.hpp:88
Generator< const Entity > each() const noexcept
Creates a generator that iterates over all entities in the entity manager.
EntityEventManager & mEventManager
The event manager that should receive notifications from the EntityManager.
Definition EntityManager.hpp:82
const World & getWorld() const noexcept
Definition EntityManager.hpp:438
Vector< EntityID > allocate(EntityIndex n, const Entity &parent=nullEntity)
Allocates n new entity IDs.
EntityIDAllocator mAllocator
The entity ID allocator.
Definition EntityManager.hpp:62
Vector< Entity > create(EntityIndex n, const Entity &parent=nullEntity)
Creates n new entities.
EntityActionManager * mActionManager
The event manager that should receive notifications from the EntityManager.
Definition EntityManager.hpp:86
Vector< EntityMetadata > mEntityMetadata
A vector containing metadata for an allocated entity.
Definition EntityManager.hpp:68
A type-safe entity type.
Definition Entity.hpp:538
Definition EntityQuery.hpp:16
A generator represents a coroutine type that produces a sequence of values of type T,...
Definition Generator.hpp:50
An implementation of the ComponentType interface that implements type-erased operations for component...
Definition Component.hpp:529
Definition Component.hpp:117
Definition Application.hpp:19
decltype(auto) get(BezierPath::Element &element) noexcept
Decomposes a bezier path element.
Definition BezierPath.hpp:723
auto with(Executor executor)
Definition ExecutionContext.hpp:546
std::vector< T, ScopedAllocatorAdaptor< StdAllocator< T, RawAllocator > > > Vector
Vector is a sequence container that encapsulates dynamic size arrays.
Definition Vector.hpp:17
std::unordered_map< Key, T, Hash, KeyEqual, ScopedAllocatorAdaptor< StdAllocator< Pair< const Key, T >, RawAllocator > > > HashMap
HashMap is an associative container that contains key-value pairs with unique keys.
Definition Map.hpp:33
ComponentDirtyBit
Definition EntityManager.hpp:40
std::bitset< 128 > ComponentMask
A bitset that represents a components mask (i.e. a set of components)
Definition Component.hpp:35
auto parent(const Entity &parent)
Sets the entity parent.
Definition Helpers.hpp:52
constexpr auto predicate(Callable &&callable) noexcept
Helper function to create a new predicate from a lambda.
Definition Predicate.hpp:390
EntityDirtyBit
Definition EntityManager.hpp:30
void copy(const A &a, B &b, T &&t=T())
Copies values from one container to another.
Definition Iterator.hpp:564
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
unsigned int ComponentID
A numeric type that represents a component.
Definition Component.hpp:32
std::map< Key, T, Compare, ScopedAllocatorAdaptor< StdAllocator< Pair< const Key, T >, RawAllocator > > > Map
Map is a sorted associative container that contains key-value pairs with unique keys.
Definition Map.hpp:24
UInt32 EntityIndex
Definition EntityID.hpp:22
A abstract class that provides a trait that allows checking for component implementations.
Definition Component.hpp:39
An abstract type that represents a generic component listener.
Definition Component.hpp:390
Definition NamedType.hpp:237
Definition Forward.hpp:28
Components serve as the base for data storage for an entity.
Definition Component.hpp:68
Definition EntityID.hpp:25
Wrapper around an enum that allows simple use of bitwise logic operations.
Definition Flags.hpp:19
A type that predicate types must extend to allow automatic operator overloading.
Definition Predicate.hpp:19