WorldCommand Class
Abstract base class for commands that operate on the entire GameWorld. More...
Declaration
Derived Classes
| class | UpdateScoreCommand |
|
Command that carries score update information. More... | |
| class | DespawnCommand |
|
Command to request despawning of a GameObject. More... | |
| class | ScheduledSpawnPlanCommand |
|
Command for executing a scheduled spawn plan. More... | |
| class | SpawnCommand |
|
Command to request spawning of GameObjects from a pool. More... | |
Public Destructor Index
| ~WorldCommand ()=default | |
|
Virtual destructor to ensure proper cleanup of derived classes. More... | |
Public Member Functions Index
| void | execute (helios::engine::runtime::world::GameWorld &gameWorld) const noexcept=0 |
|
Executes the command against the entire GameWorld. More... | |
| void | accept (helios::engine::runtime::world::GameWorld &gameWorld, helios::engine::runtime::messaging::command::WorldCommandDispatcher &dispatcher) const noexcept |
|
Accepts a dispatcher for type-safe command handling. More... | |
Description
Abstract base class for commands that operate on the entire GameWorld.
Unlike TargetedCommand which operates on a specific GameObject, a WorldCommand executes against the entire GameWorld. This is useful for global game actions such as spawning entities, clearing levels, or applying world-wide effects.
WorldCommands support the Visitor pattern through accept(), enabling type-safe dispatch to specialized handlers without explicit type checking.
- See Also
TargetedCommand for commands targeting specific GameObjects
- See Also
WorldCommandDispatcher for type-safe command dispatch
Definition at line 31 of file WorldCommand.ixx.
Public Destructor
~WorldCommand()
| virtual default |
Virtual destructor to ensure proper cleanup of derived classes.
Definition at line 38 of file WorldCommand.ixx.
Public Member Functions
accept()
| inline noexcept virtual |
Accepts a dispatcher for type-safe command handling.
- Parameters
-
gameWorld The game world context.
dispatcher The dispatcher to delegate command handling to.
Override this method in derived commands to enable dispatch to specialized handlers. The default implementation is a no-op.
Definition at line 58 of file WorldCommand.ixx.
execute()
| noexcept |
Executes the command against the entire GameWorld.
- Parameters
-
gameWorld The game world to apply the command to.
Implementations must be exception-safe (noexcept).
Definition at line 47 of file WorldCommand.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.