Skip to main content

DespawnCommand.ixx File

Command for requesting GameObject despawning and pool return. More...

Included Headers

#include <cassert> #include <optional> #include <helios.engine.runtime.spawn.types.SpawnProfileId> #include <helios.engine.ecs.EntityHandle>

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...

namespacecommands

Commands for spawn and despawn operations. More...

Classes Index

classDespawnCommand

Command to request despawning of a GameObject. More...

Description

Command for requesting GameObject despawning and pool return.

File Listing

The file content with the documentation metadata removed is:

1/**
2 * @file DespawnCommand.ixx
3 * @brief Command for requesting GameObject despawning and pool return.
4 */
5module;
6
7#include <cassert>
8#include <optional>
9
10export module helios.engine.runtime.spawn.commands.DespawnCommand;
11
12import helios.engine.ecs.EntityHandle;
13
14
15
16import helios.engine.runtime.spawn.types.SpawnProfileId;
17
18
20
21 /**
22 * @brief Command to request despawning of a GameObject.
23 *
24 * @details DespawnCommand is a WorldCommand that requests the deactivation
25 * and return of a GameObject to its pool. The command identifies the target
26 * entity by its handle and specifies the spawn profile for pool return.
27 *
28 * The command is dispatched to a DespawnCommandDispatcher which forwards it
29 * to the appropriate SpawnManager for deferred processing.
30 *
31 * @see SpawnCommand
32 * @see DespawnCommandDispatcher
33 * @see SpawnManager
34 */
36
37 /**
38 * @brief The handle of the entity to despawn.
39 */
41
42 /**
43 * @brief The spawn profile ID for pool return.
44 */
46
47 public:
48
49 /**
50 * @brief Constructs a DespawnCommand with a target profile.
51 *
52 * @param entityHandle The handle of the entity to despawn.
53 * @param spawnProfileId The spawn profile ID for pool return.
54 */
55 explicit DespawnCommand(
58 entityHandle_(entityHandle), spawnProfileId_(spawnProfileId) {}
59
60
61 /**
62 * @brief Returns the handle of the entity to despawn.
63 *
64 * @return The entity handle.
65 */
66 [[nodiscard]] helios::engine::ecs::EntityHandle entityHandle() const noexcept {
67 return entityHandle_;
68 }
69
70 /**
71 * @brief Returns the spawn profile ID for pool return.
72 *
73 * @return The spawn profile ID associated with this command.
74 */
76 return spawnProfileId_;
77 }
78
79 };
80
81
82}

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.