Skip to main content

SpawnCommandHandler Class

Interface for handlers that process spawn and despawn commands. More...

Declaration

class helios::engine::runtime::spawn::SpawnCommandHandler { ... }

Derived Classes

classSpawnManager

Manager for processing spawn and despawn commands. More...

Public Destructor Index

~SpawnCommandHandler ()=default

Virtual destructor for proper polymorphic cleanup. More...

Public Member Functions Index

boolsubmit (const helios::engine::runtime::spawn::commands::DespawnCommand &despawnCommand) noexcept=0

Submits a despawn command to return an entity to its pool. More...

boolsubmit (const helios::engine::runtime::spawn::commands::SpawnCommand &spawnCommand) noexcept=0

Submits a spawn command to acquire an entity from the pool. More...

boolsubmit (const helios::engine::runtime::spawn::commands::ScheduledSpawnPlanCommand &scheduledSpawnPlanCommand) noexcept=0

Submits a scheduled spawn plan command for batch spawning. More...

Description

Interface for handlers that process spawn and despawn commands.

SpawnCommandHandler defines the contract for managers that handle entity lifecycle operations for GameObjectPools. Each handler is registered with a SpawnProfileId via `GameWorld::registerSpawnCommandHandler()`.

When a pooled entity needs to spawn or despawn, the appropriate handler is looked up by profile ID and receives the command for deferred processing.

## Command Types

  • **SpawnCommand:** Commands acquisition of an entity from the pool
  • **DespawnCommand:** Commands return of an entity to the pool
  • **ScheduledSpawnPlanCommand:** Commands batch spawning from scheduler

## Implementation Notes

Handlers typically also implement the Manager interface to receive flush() calls for deferred command processing during the manager flush phase.

Example: ```cpp class MyPoolManager : public Manager, public SpawnCommandHandler { bool submit(const SpawnCommand& cmd) noexcept override { spawnQueue_.push(cmd); return true; } bool submit(const DespawnCommand& cmd) noexcept override { despawnQueue_.push(cmd); return true; } bool submit(const ScheduledSpawnPlanCommand& cmd) noexcept override { planQueue_.push(cmd); return true; } void flush(GameWorld& world, UpdateContext& ctx) noexcept override { // Process queued commands } }; ```

See Also

SpawnCommand

See Also

DespawnCommand

See Also

ScheduledSpawnPlanCommand

See Also

SpawnManager

See Also

PoolManagerRegistry

Definition at line 63 of file SpawnCommandHandler.ixx.

Public Destructor

~SpawnCommandHandler()

virtual helios::engine::runtime::spawn::SpawnCommandHandler::~SpawnCommandHandler ()
virtual default

Virtual destructor for proper polymorphic cleanup.

Definition at line 70 of file SpawnCommandHandler.ixx.

Public Member Functions

submit()

virtual bool helios::engine::runtime::spawn::SpawnCommandHandler::submit (const helios::engine::runtime::spawn::commands::DespawnCommand & despawnCommand)
noexcept

Submits a despawn command to return an entity to its pool.

Parameters
despawnCommand

The command containing entity handle and profile ID.

Returns

true if the command was accepted, false otherwise.

Definition at line 79 of file SpawnCommandHandler.ixx.

submit()

virtual bool helios::engine::runtime::spawn::SpawnCommandHandler::submit (const helios::engine::runtime::spawn::commands::SpawnCommand & spawnCommand)
noexcept

Submits a spawn command to acquire an entity from the pool.

Parameters
spawnCommand

The command containing profile ID and spawn context.

Returns

true if the command was accepted, false otherwise.

Definition at line 90 of file SpawnCommandHandler.ixx.

submit()

virtual bool helios::engine::runtime::spawn::SpawnCommandHandler::submit (const helios::engine::runtime::spawn::commands::ScheduledSpawnPlanCommand & scheduledSpawnPlanCommand)
noexcept

Submits a scheduled spawn plan command for batch spawning.

Parameters
scheduledSpawnPlanCommand

The command containing the spawn plan and spawn context.

Returns

true if the command was accepted, false otherwise.

Definition at line 102 of file SpawnCommandHandler.ixx.


The documentation for this class was generated from the following file:


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.