Skip to main content

SpawnCommand Class

Command to request spawning of GameObjects from a pool. More...

Declaration

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

Public Constructors Index

SpawnCommand (const SpawnProfileId spawnProfileId, const SpawnContext &spawnContext, const size_t spawnBudget=1)

Constructs a SpawnCommand. More...

Public Member Functions Index

SpawnProfileIdspawnProfileId () const noexcept

Returns the target pool ID. More...

size_tspawnBudget () const noexcept

Returns the spawn budget. More...

SpawnContextspawnContext () const noexcept

Returns the spawn context. More...

Private Member Attributes Index

size_tspawnBudget_

The number of GameObjects to spawn. More...

SpawnProfileIdspawnProfileId_

Profile identifying the spawn configuration. More...

SpawnContextspawnContext_

Context providing spawn-time information (e.g., emitter). More...

Description

Command to request spawning of GameObjects from a pool.

SpawnCommand is a WorldCommand that requests the activation of GameObjects from a specific pool. The command carries a spawn budget indicating how many objects should be spawned.

The command itself does not execute spawning directly. Instead, it is dispatched to a SpawnCommandDispatcher which forwards the command to the appropriate SpawnManager for deferred processing.

See Also

SpawnCommandDispatcher

See Also

SpawnManager

See Also

GameObjectSpawnSystem

Definition at line 36 of file SpawnCommand.ixx.

Public Constructors

SpawnCommand()

helios::engine::runtime::spawn::commands::SpawnCommand::SpawnCommand (const SpawnProfileId spawnProfileId, const SpawnContext & spawnContext, const size_t spawnBudget=1)
inline explicit

Constructs a SpawnCommand.

Parameters
spawnProfileId

The profile identifying the spawn configuration.

spawnContext

Context providing spawn-time information.

spawnBudget

Number of objects to spawn (default: 1).

Definition at line 62 of file SpawnCommand.ixx.

62 explicit SpawnCommand(
65 const size_t spawnBudget = 1
66 ) :
67 spawnProfileId_(spawnProfileId),
68 spawnContext_(spawnContext),
69 spawnBudget_(spawnBudget)
70 {}

References spawnBudget, spawnContext and spawnProfileId.

Public Member Functions

spawnBudget()

size_t helios::engine::runtime::spawn::commands::SpawnCommand::spawnBudget ()
inline nodiscard noexcept

Returns the spawn budget.

Returns

The number of objects to spawn.

Definition at line 87 of file SpawnCommand.ixx.

87 [[nodiscard]] size_t spawnBudget() const noexcept {
88 return spawnBudget_;
89 }

Referenced by SpawnCommand.

spawnContext()

SpawnContext helios::engine::runtime::spawn::commands::SpawnCommand::spawnContext ()
inline nodiscard noexcept

Returns the spawn context.

Returns

The spawn context of this command.

Definition at line 96 of file SpawnCommand.ixx.

96 [[nodiscard]] SpawnContext spawnContext() const noexcept {
97 return spawnContext_;
98 }

Referenced by SpawnCommand.

spawnProfileId()

SpawnProfileId helios::engine::runtime::spawn::commands::SpawnCommand::spawnProfileId ()
inline nodiscard noexcept

Returns the target pool ID.

Returns

The GameObjectPoolId to spawn from.

Definition at line 78 of file SpawnCommand.ixx.

78 [[nodiscard]] SpawnProfileId spawnProfileId() const noexcept {
79 return spawnProfileId_;
80 }

Referenced by SpawnCommand.

Private Member Attributes

spawnBudget_

size_t helios::engine::runtime::spawn::commands::SpawnCommand::spawnBudget_

The number of GameObjects to spawn.

Definition at line 41 of file SpawnCommand.ixx.

41 size_t spawnBudget_;

spawnContext_

SpawnContext helios::engine::runtime::spawn::commands::SpawnCommand::spawnContext_

Context providing spawn-time information (e.g., emitter).

Definition at line 51 of file SpawnCommand.ixx.

51 SpawnContext spawnContext_;

spawnProfileId_

SpawnProfileId helios::engine::runtime::spawn::commands::SpawnCommand::spawnProfileId_

Profile identifying the spawn configuration.

Definition at line 46 of file SpawnCommand.ixx.

46 SpawnProfileId spawnProfileId_;

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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.