DespawnCommand Class
Command to request despawning of a GameObject. More...
Declaration
Base class
| class | WorldCommand |
|
Abstract base class for commands that operate on the entire GameWorld. More... | |
Public Constructors Index
| DespawnCommand (const helios::engine::ecs::EntityHandle &entityHandle, const helios::engine::core::data::SpawnProfileId spawnProfileId) | |
|
Constructs a DespawnCommand with a target profile. More... | |
Public Member Functions Index
| void | execute (helios::engine::runtime::world::GameWorld &gameWorld) const noexcept override |
|
Direct execution is not supported; requires a dispatcher. More... | |
| void | accept (helios::engine::runtime::world::GameWorld &gameWorld, helios::engine::runtime::messaging::command::WorldCommandDispatcher &dispatcher) const noexcept override |
|
Accepts a dispatcher for command routing. More... | |
| helios::engine::ecs::EntityHandle | entityHandle () const noexcept |
|
Returns the handle of the entity to despawn. More... | |
| helios::engine::core::data::SpawnProfileId | spawnProfileId () const noexcept |
|
Returns the spawn profile ID for pool return. More... | |
Private Member Attributes Index
| const helios::engine::ecs::EntityHandle | guid_ |
|
The handle of the entity to despawn. More... | |
| helios::engine::core::data::SpawnProfileId | spawnProfileId_ |
|
The spawn profile ID for pool return. More... | |
Description
Command to request despawning of a GameObject.
DespawnCommand is a WorldCommand that requests the deactivation and return of a GameObject to its pool. The command identifies the target entity by its handle and specifies the spawn profile for pool return.
The command is dispatched to a DespawnCommandDispatcher which forwards it to the appropriate SpawnManager for deferred processing.
- See Also
- See Also
DespawnCommandDispatcher
- See Also
Definition at line 37 of file DespawnCommand.ixx.
Public Constructors
DespawnCommand()
| inline explicit |
Constructs a DespawnCommand with a target profile.
- Parameters
-
entityHandle The handle of the entity to despawn.
spawnProfileId The spawn profile ID for pool return.
Definition at line 57 of file DespawnCommand.ixx.
References entityHandle and spawnProfileId.
Public Member Functions
accept()
| inline noexcept virtual |
Accepts a dispatcher for command routing.
- Parameters
-
gameWorld The game world.
dispatcher The dispatcher to route this command to.
Definition at line 79 of file DespawnCommand.ixx.
entityHandle()
| inline nodiscard noexcept |
Returns the handle of the entity to despawn.
- Returns
The entity handle.
Definition at line 91 of file DespawnCommand.ixx.
Referenced by DespawnCommand.
execute()
| inline noexcept virtual |
Direct execution is not supported; requires a dispatcher.
- Parameters
-
gameWorld The game world (unused).
Asserts in debug builds if called directly.
Definition at line 69 of file DespawnCommand.ixx.
spawnProfileId()
| inline nodiscard noexcept |
Returns the spawn profile ID for pool return.
- Returns
The spawn profile ID associated with this command.
Definition at line 100 of file DespawnCommand.ixx.
Referenced by DespawnCommand.
Private Member Attributes
guid_
|
The handle of the entity to despawn.
Definition at line 42 of file DespawnCommand.ixx.
spawnProfileId_
|
The spawn profile ID for pool return.
Definition at line 47 of file DespawnCommand.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.