EngineWorld Class
Top-level aggregate world that dispatches entity operations to the correct domain-specific TypedHandleWorld based on the handle type. More...
Declaration
Public Member Functions Index
| GameObjectWorld & | gameObjectWorld () |
|
Returns the game-object and scene sub-world. More... | |
| PlatformWorld & | platformWorld () |
|
Returns the platform (window, environment) sub-world. More... | |
| RenderResourceWorld & | renderResourceWorld () |
|
Returns the render-resource (shader, material, mesh) sub-world. More... | |
| RenderTargetWorld & | renderTargetWorld () |
|
Returns the render-target and viewport sub-world. More... | |
template <typename THandle> | |
| auto | clone (THandle source) noexcept |
|
Clones an entity within the sub-world appropriate for THandle. More... | |
template <typename THandle> | |
| auto & | entityManager () noexcept |
|
Returns the entity manager responsible for THandle. More... | |
template <typename THandle, typename TComponent> | |
| auto * | sparseSet () noexcept |
|
Returns the SparseSet<TComponent> from the entity manager for THandle. More... | |
template <typename THandle> | |
| bool | isValid (THandle handle) noexcept |
|
Returns whether handle refers to a living entity. More... | |
template <typename THandle> | |
| auto | find (THandle handle) noexcept |
|
Finds and returns an Entity wrapper for handle. More... | |
template <typename THandle> | |
| auto | add (typename THandle::StrongId_type strongId=typename THandle::StrongId_type{}) |
|
Creates a new entity in the sub-world appropriate for THandle. More... | |
template <typename THandle, typename... TComponents> | |
| auto | view () |
|
Returns a View over entities with TComponents in the sub-world for THandle. More... | |
template <typename THandle> | |
| auto | destroy (const THandle handle) |
|
Destroys an entity in the sub-world appropriate for THandle. More... | |
template <typename THandle = void, typename... TComponents> | |
| void | clearDirtySets () |
|
Clears dirty sets across all sub-worlds or for a specific handle and component list. More... | |
Private Member Functions Index
template < ... > | |
| void | clearDirtySetsForHandles (TWorld &world, type_list< THandles... >) |
|
Clears all dirty sets for every handle type in THandles inside world. More... | |
Private Member Attributes Index
| GameObjectWorld | gameObjectWorld_ {} |
| RenderResourceWorld | renderResourceWorld_ {} |
| PlatformWorld | platformWorld_ {} |
| RenderTargetWorld | renderTargetWorld_ {} |
Description
Top-level aggregate world that dispatches entity operations to the correct domain-specific TypedHandleWorld based on the handle type.
Routes add, find, view, destroy, clone, clearDirtySets, etc. to one of four sub-worlds: game objects, render resources, platform, or render targets.
Definition at line 133 of file EngineWorld.ixx.
Public Member Functions
add()
| inline |
Creates a new entity in the sub-world appropriate for THandle.
- Template Parameters
-
THandle Handle type that determines the target sub-world.
- Parameters
-
strongId Optional strong identifier for the new entity.
- Returns
Entity wrapper for the newly created entity.
Definition at line 303 of file EngineWorld.ixx.
clearDirtySets()
| inline |
Clears dirty sets across all sub-worlds or for a specific handle and component list.
When called as clearDirtySets<>() (no template args), clears all dirty sets in every sub-world. When called as clearDirtySets<THandle, TComponents...>(), only the matching sub-world and component types are affected.
- Template Parameters
-
THandle Handle type selecting the sub-world (void = all worlds).
TComponents Component types whose dirty sets are cleared (empty = all).
Definition at line 372 of file EngineWorld.ixx.
References clearDirtySets and helios::engine::runtime::registerComponents.
Referenced by clearDirtySets and helios::engine::runtime::world::UpdateContext::clearDirtySets.
clone()
| inline noexcept |
Clones an entity within the sub-world appropriate for THandle.
- Template Parameters
-
THandle Handle type of the entity to clone.
- Parameters
-
source Handle of the source entity.
- Returns
Entity wrapper for the newly cloned entity.
Definition at line 190 of file EngineWorld.ixx.
Reference helios::engine::runtime::registerComponents.
destroy()
| inline |
Destroys an entity in the sub-world appropriate for THandle.
- Template Parameters
-
THandle Deduced handle type.
- Parameters
-
handle Handle of the entity to destroy.
- Returns
true if destroyed, false if the handle was already invalid.
Definition at line 347 of file EngineWorld.ixx.
Reference helios::engine::runtime::registerComponents.
entityManager()
| inline noexcept |
Returns the entity manager responsible for THandle.
- Template Parameters
-
THandle Handle type whose manager is requested.
- Returns
Reference to the matching entity manager.
Definition at line 212 of file EngineWorld.ixx.
Reference helios::engine::runtime::registerComponents.
find()
| inline noexcept |
Finds and returns an Entity wrapper for handle.
- Template Parameters
-
THandle Deduced handle type.
- Parameters
-
handle Handle to look up.
- Returns
Entity wrapper, or an invalid wrapper if not found.
Definition at line 280 of file EngineWorld.ixx.
Reference helios::engine::runtime::registerComponents.
Referenced by helios::engine::runtime::pooling::EntityPoolManager< TEntity >::acquire and helios::engine::runtime::pooling::EntityPoolManager< TEntity >::release.
gameObjectWorld()
| inline |
Returns the game-object and scene sub-world.
Definition at line 157 of file EngineWorld.ixx.
Referenced by helios::engine::runtime::world::GameWorld::gameObjectWorld.
isValid()
| inline noexcept |
Returns whether handle refers to a living entity.
- Template Parameters
-
THandle Deduced handle type.
- Parameters
-
handle Handle to validate.
Definition at line 257 of file EngineWorld.ixx.
References isValid and helios::engine::runtime::registerComponents.
Referenced by isValid.
platformWorld()
| inline |
Returns the platform (window, environment) sub-world.
Definition at line 164 of file EngineWorld.ixx.
Referenced by helios::engine::runtime::world::GameWorld::platformWorld.
renderResourceWorld()
| inline |
Returns the render-resource (shader, material, mesh) sub-world.
Definition at line 171 of file EngineWorld.ixx.
Referenced by helios::engine::runtime::world::GameWorld::renderResourceWorld.
renderTargetWorld()
| inline |
Returns the render-target and viewport sub-world.
Definition at line 178 of file EngineWorld.ixx.
Referenced by helios::engine::runtime::world::GameWorld::renderTargetWorld.
sparseSet()
| inline noexcept |
Returns the SparseSet<TComponent> from the entity manager for THandle.
- Template Parameters
-
THandle Handle type identifying the sub-world.
TComponent Component type whose storage is requested.
- Returns
Non-owning pointer to the sparse set, or nullptr if not allocated.
Definition at line 235 of file EngineWorld.ixx.
Reference helios::engine::runtime::registerComponents.
view()
| inline |
Returns a View over entities with TComponents in the sub-world for THandle.
- Template Parameters
-
THandle Handle type identifying the sub-world.
TComponents Required component types.
Definition at line 324 of file EngineWorld.ixx.
References helios::engine::runtime::registerComponents and view.
Referenced by helios::engine::runtime::pooling::EntityPoolManager< TEntity >::init, view, helios::engine::runtime::world::GameWorld::view and helios::engine::runtime::world::UpdateContext::view.
Private Member Functions
clearDirtySetsForHandles()
| inline |
Clears all dirty sets for every handle type in THandles inside world.
- Template Parameters
-
TWorld Sub-world type.
TComponents Component types to clear (empty = clear all).
THandles Handle types derived from the world's entity managers.
Definition at line 148 of file EngineWorld.ixx.
Private Member Attributes
gameObjectWorld_
|
Definition at line 135 of file EngineWorld.ixx.
platformWorld_
|
Definition at line 137 of file EngineWorld.ixx.
renderResourceWorld_
|
Definition at line 136 of file EngineWorld.ixx.
renderTargetWorld_
|
Definition at line 138 of file EngineWorld.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.