Skip to main content

SpawnCommand.ixx File

Command for requesting GameObject spawning from a pool. More...

Included Headers

#include <cassert> #include <cinttypes> #include <expected> #include <helios.math.types> #include <helios.engine.runtime.spawn.types>

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

classSpawnCommand

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

Description

Command for requesting GameObject spawning from a pool.

File Listing

The file content with the documentation metadata removed is:

1/**
2 * @file SpawnCommand.ixx
3 * @brief Command for requesting GameObject spawning from a pool.
4 */
5module;
6
7#include <cassert>
8#include <cinttypes>
9#include <expected>
10
11export module helios.engine.runtime.spawn.commands.SpawnCommand;
12
13import helios.engine.runtime.spawn.types;
14
15import helios.math.types;
16
17
20
21 /**
22 * @brief Command to request spawning of GameObjects from a pool.
23 *
24 * @details SpawnCommand is a WorldCommand that requests the activation of
25 * GameObjects from a specific pool. The command carries a spawn budget
26 * indicating how many objects should be spawned.
27 *
28 * The command itself does not execute spawning directly. Instead, it is
29 * dispatched to a SpawnCommandDispatcher which forwards the command to the
30 * appropriate SpawnManager for deferred processing.
31 *
32 * @see SpawnCommandDispatcher
33 * @see SpawnManager
34 * @see GameObjectSpawnSystem
35 */
37
38 /**
39 * @brief The number of GameObjects to spawn.
40 */
41 size_t spawnBudget_;
42
43 /**
44 * @brief Profile identifying the spawn configuration.
45 */
46 SpawnProfileId spawnProfileId_;
47
48 /**
49 * @brief Context providing spawn-time information (e.g., emitter).
50 */
51 SpawnContext spawnContext_;
52
53 public:
54
55 /**
56 * @brief Constructs a SpawnCommand.
57 *
58 * @param spawnProfileId The profile identifying the spawn configuration.
59 * @param spawnContext Context providing spawn-time information.
60 * @param spawnBudget Number of objects to spawn (default: 1).
61 */
62 explicit SpawnCommand(
65 const size_t spawnBudget = 1
66 ) :
67 spawnProfileId_(spawnProfileId),
68 spawnContext_(spawnContext),
69 spawnBudget_(spawnBudget)
70 {}
71
72
73 /**
74 * @brief Returns the target pool ID.
75 *
76 * @return The GameObjectPoolId to spawn from.
77 */
78 [[nodiscard]] SpawnProfileId spawnProfileId() const noexcept {
79 return spawnProfileId_;
80 }
81
82 /**
83 * @brief Returns the spawn budget.
84 *
85 * @return The number of objects to spawn.
86 */
87 [[nodiscard]] size_t spawnBudget() const noexcept {
88 return spawnBudget_;
89 }
90
91 /**
92 * @brief Returns the spawn context.
93 *
94 * @return The spawn context of this command.
95 */
96 [[nodiscard]] SpawnContext spawnContext() const noexcept {
97 return spawnContext_;
98 }
99 };
100
101
102}

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.