Skip to main content

ScheduledSpawnPlanCommand.ixx File

Command for executing a scheduled spawn plan. More...

Included Headers

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

classScheduledSpawnPlanCommand

Command for executing a scheduled spawn plan. More...

Description

Command for executing a scheduled spawn plan.

File Listing

The file content with the documentation metadata removed is:

1/**
2 * @file ScheduledSpawnPlanCommand.ixx
3 * @brief Command for executing a scheduled spawn plan.
4 */
5module;
6
7#include <cassert>
8#include <memory>
9
10export module helios.engine.runtime.spawn.commands.ScheduledSpawnPlanCommand;
11
12import helios.engine.runtime.spawn.scheduling.ScheduledSpawnPlan;
13
14
15import helios.engine.runtime.spawn.types.SpawnContext;
16import helios.engine.runtime.spawn.scheduling.SpawnPlan;
17import helios.engine.runtime.spawn.types.SpawnProfileId;
18
19
23
24 /**
25 * @brief Command for executing a scheduled spawn plan.
26 *
27 * @details ScheduledSpawnPlanCommand wraps a ScheduledSpawnPlan and routes
28 * it to the appropriate dispatcher for execution. The command itself does
29 * not perform spawning directly; instead, it delegates to a dispatcher
30 * which forwards the command to the SpawnManager.
31 *
32 * ## Execution Flow
33 *
34 * 1 GameObjectSpawnSystem creates command from ScheduledSpawnPlan
35 * 2 Command is added to CommandBuffer
36 * 3 CommandBuffer flushes and calls accept() on each command
37 * 4 Dispatcher routes command to SpawnManager
38 * 5 SpawnManager processes the spawn command
39 *
40 * @see ScheduledSpawnPlan
41 * @see ScheduledSpawnPlanCommandDispatcher
42 * @see SpawnManager
43 */
45
46 /**
47 * @brief Profile identifying the spawn configuration.
48 */
50
51 /**
52 * @brief The spawn plan containing rule ID and amount.
53 */
55
56 /**
57 * @brief Context providing spawn-time information.
58 */
59 SpawnContext spawnContext_;
60
61 public:
62
63 /**
64 * @brief Constructs a command with the given spawn plan.
65 *
66 * @param spawnProfileId The profile ID for spawning.
67 * @param spawnPlan The spawn plan containing rule ID and amount.
68 * @param spawnContext The context for spawn operations.
69 */
74 ) :
75 spawnProfileId_(spawnProfileId),
76 spawnPlan_(spawnPlan),
77 spawnContext_(spawnContext)
78 {}
79
80 /**
81 * @brief Retrieves the spawn profile identifier associated with the command.
82 *
83 * @return The spawn profile identifier encapsulated within the ScheduledSpawnPlanCommand.
84 */
85 [[nodiscard]] SpawnProfileId spawnProfileId() const noexcept {
86 return spawnProfileId_;
87 }
88
89 /**
90 * @brief Returns the spawn plan associated with this instance.
91 *
92 * @return A structured plan that can be executed by the spawn management system.
93 */
94 [[nodiscard]] SpawnPlan spawnPlan() const noexcept {
95 return spawnPlan_;
96 }
97
98 /**
99 * @brief Retrieves the spawn context associated with this instance.
100 *
101 * @return The spawn context.
102 */
103 [[nodiscard]] SpawnContext spawnContext() const noexcept {
104 return spawnContext_;
105 }
106
107 };
108
109
110}

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.