Skip to main content

DespawnCommand Class

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

Declaration

class helios::engine::runtime::spawn::commands::DespawnCommand { ... }

Base class

classWorldCommand

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

voidexecute (helios::engine::runtime::world::GameWorld &gameWorld) const noexcept override

Direct execution is not supported; requires a dispatcher. More...

voidaccept (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::EntityHandleentityHandle () const noexcept

Returns the handle of the entity to despawn. More...

helios::engine::core::data::SpawnProfileIdspawnProfileId () const noexcept

Returns the spawn profile ID for pool return. More...

Private Member Attributes Index

const helios::engine::ecs::EntityHandleguid_

The handle of the entity to despawn. More...

helios::engine::core::data::SpawnProfileIdspawnProfileId_

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

SpawnCommand

See Also

DespawnCommandDispatcher

See Also

SpawnManager

Definition at line 37 of file DespawnCommand.ixx.

Public Constructors

DespawnCommand()

helios::engine::runtime::spawn::commands::DespawnCommand::DespawnCommand (const helios::engine::ecs::EntityHandle & entityHandle, const helios::engine::core::data::SpawnProfileId spawnProfileId)
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()

void helios::engine::runtime::spawn::commands::DespawnCommand::accept (helios::engine::runtime::world::GameWorld & gameWorld, helios::engine::runtime::messaging::command::WorldCommandDispatcher & dispatcher)
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.

79 void accept(
82 ) const noexcept override {
83 dispatcher.dispatch(gameWorld, *this);
84 }

entityHandle()

helios::engine::ecs::EntityHandle helios::engine::runtime::spawn::commands::DespawnCommand::entityHandle ()
inline nodiscard noexcept

Returns the handle of the entity to despawn.

Returns

The entity handle.

Definition at line 91 of file DespawnCommand.ixx.

91 [[nodiscard]] helios::engine::ecs::EntityHandle entityHandle() const noexcept {
92 return guid_;
93 }

Referenced by DespawnCommand.

execute()

void helios::engine::runtime::spawn::commands::DespawnCommand::execute (helios::engine::runtime::world::GameWorld & gameWorld)
inline noexcept virtual

Direct execution is not supported; requires a dispatcher.

Parameters
gameWorld

The game world (unused).

info

Asserts in debug builds if called directly.

Definition at line 69 of file DespawnCommand.ixx.

69 void execute(helios::engine::runtime::world::GameWorld& gameWorld) const noexcept override {
70 assert(false && "Unexpected execute() for despawn, needs dispatcher");
71 }

spawnProfileId()

helios::engine::core::data::SpawnProfileId helios::engine::runtime::spawn::commands::DespawnCommand::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.

101 return spawnProfileId_;
102 }

Referenced by DespawnCommand.

Private Member Attributes

guid_

const helios::engine::ecs::EntityHandle helios::engine::runtime::spawn::commands::DespawnCommand::guid_

The handle of the entity to despawn.

Definition at line 42 of file DespawnCommand.ixx.

spawnProfileId_

helios::engine::core::data::SpawnProfileId helios::engine::runtime::spawn::commands::DespawnCommand::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.