Skip to main content

DespawnCommandDispatcher.ixx File

Dispatcher for routing DespawnCommands to the SpawnManager. More...

Included Headers

Namespaces Index

namespacehelios
namespaceengine

Main engine module aggregating core infrastructure and game systems. More...

namespaceruntime

Runtime infrastructure for game execution and lifecycle orchestration. More...

namespacespawn

Entity spawning infrastructure for the helios engine. More...

namespacedispatcher

Command dispatchers for spawn operations. More...

Classes Index

classDespawnCommandDispatcher

Dispatcher that routes DespawnCommands to the appropriate handler. More...

Description

Dispatcher for routing DespawnCommands to the SpawnManager.

File Listing

The file content with the documentation metadata removed is:

1/**
2 * @file DespawnCommandDispatcher.ixx
3 * @brief Dispatcher for routing DespawnCommands to the SpawnManager.
4 */
5module;
6
7#include <cassert>
8
9export module helios.engine.runtime.spawn.dispatcher.DespawnCommandDispatcher;
10
11import helios.engine.runtime.spawn.commands.DespawnCommand;
12import helios.engine.runtime.messaging.command.TypedWorldCommandDispatcher;
13import helios.engine.runtime.world.GameWorld;
14
16
17 /**
18 * @brief Dispatcher that routes DespawnCommands to the appropriate handler.
19 *
20 * @details DespawnCommandDispatcher is a typed command dispatcher that handles
21 * DespawnCommand instances. When a DespawnCommand is dispatched, it submits
22 * the command directly to the pool's registered SpawnCommandHandler.
23 *
24 * The dispatcher requires that the DespawnCommand has a valid SpawnProfileId.
25 * Despawning without pool ownership is not yet supported.
26 *
27 * @see DespawnCommand
28 * @see SpawnManager
29 * @see SpawnCommandHandler
30 */
32 helios::engine::runtime::spawn::commands::DespawnCommand> {
33
34 protected:
35
36 /**
37 * @brief Dispatches a DespawnCommand to the registered handler.
38 *
39 * @details Looks up the SpawnCommandHandler for the command's profile ID
40 * and submits the command directly for deferred processing.
41 *
42 * @param gameWorld The game world containing the entity.
43 * @param command The DespawnCommand to dispatch.
44 *
45 * @pre command.spawnProfileId() must have a value.
46 */
50 ) noexcept override {
51
52 if (auto* spawnCommandHandler = gameWorld.spawnCommandHandler(command.spawnProfileId())) {
53 spawnCommandHandler->submit(command);
54 }
55 }
56
57 public:
58
59 /**
60 * @brief Default constructor.
61 */
63
64 };
65
66
67}

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.