WorldLifecycleManager Class
Manager that processes deferred world lifecycle commands. More...
Declaration
Base classes
| class | Manager |
|
Abstract base class for managers that process deferred operations. More... | |
| class | TypedCommandHandler<CommandType> |
|
Type-safe handler for a specific command type. More... | |
Public Member Functions Index
| bool | submit (WorldLifecycleCommand cmd) noexcept override |
|
Enqueues a lifecycle command for deferred processing. More... | |
| void | init (GameWorld &gameWorld) override |
|
Registers this manager as the WorldLifecycleCommand handler. More... | |
| void | flush (UpdateContext &updateContext) noexcept override |
|
Processes all pending lifecycle commands. More... | |
| void | reset () override |
|
Clears all pending commands. More... | |
Private Member Attributes Index
| std::vector< WorldLifecycleCommand > | pending_ |
|
Pending commands queued for the next flush. More... | |
| GameWorld * | gameWorld_ = nullptr |
Description
Manager that processes deferred world lifecycle commands.
WorldLifecycleManager collects WorldLifecycleCommands via submit() and executes them during flush(). This allows systems to request world-level operations (e.g. reset) through the command pipeline instead of calling GameWorld methods directly.
On Reset, the pending queue is moved to a local variable before processing. This prevents re-entrant issues since GameWorld::reset() calls Manager::reset() on all managers, including this one.
- See Also
- See Also
- See Also
Definition at line 42 of file WorldLifecycleManager.ixx.
Public Member Functions
flush()
| inline noexcept virtual |
Processes all pending lifecycle commands.
Moves the pending queue to a local variable before iterating. This is necessary because a Reset action triggers GameWorld::reset(), which in turn calls reset() on this manager, clearing pending_.
- Parameters
-
updateContext The current frame's update context.
Definition at line 89 of file WorldLifecycleManager.ixx.
Reference helios::engine::mechanics::lifecycle::types::Reset.
init()
| inline virtual |
Registers this manager as the WorldLifecycleCommand handler.
- Parameters
-
gameWorld The GameWorld to register with.
Definition at line 74 of file WorldLifecycleManager.ixx.
Reference helios::engine::runtime::world::GameWorld::registerCommandHandler.
reset()
| inline virtual |
Clears all pending commands.
Definition at line 111 of file WorldLifecycleManager.ixx.
submit()
| inline noexcept |
Enqueues a lifecycle command for deferred processing.
- Parameters
-
cmd The command to enqueue.
- Returns
True if the command was accepted.
Definition at line 64 of file WorldLifecycleManager.ixx.
Private Member Attributes
gameWorld_
|
Cached pointer to the GameWorld, set during init().
Definition at line 53 of file WorldLifecycleManager.ixx.
pending_
|
Pending commands queued for the next flush.
Definition at line 48 of file WorldLifecycleManager.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.