Skip to main content

Updatable.ixx File

Interface for components that require per-frame updates. More...

Included Headers

Namespaces Index

namespacehelios
namespaceengine

Main engine module aggregating core infrastructure and game systems. More...

namespaceecs

Core Entity-Component-System architecture. More...

Classes Index

classUpdatable

Interface for components that require per-frame updates. More...

Description

Interface for components that require per-frame updates.

File Listing

The file content with the documentation metadata removed is:

1/**
2 * @file Updatable.ixx
3 * @brief Interface for components that require per-frame updates.
4 */
5module;
6
7
8export module helios.engine.ecs.Updatable;
9
10import helios.engine.runtime.world.UpdateContext;
11
12export namespace helios::engine::ecs {
13
14 struct UpdateContext;
15
16 /**
17 * @brief Interface for components that require per-frame updates.
18 *
19 * @details Components implementing this interface will have their update()
20 * method called each frame by the owning GameObject. This enables frame-dependent
21 * behaviors such as physics simulation, animation, and input processing.
22 *
23 * Example implementation:
24 * ```cpp
25 * class PhysicsComponent : public Component, public Updatable {
26 * public:
27 * void update(UpdateContext& ctx) noexcept override {
28 * velocity_ += gravity_ * ctx.deltaTime;
29 * position_ += velocity_ * ctx.deltaTime;
30 * }
31 * };
32 * ```
33 *
34 * @note Implementations must be noexcept to prevent exceptions from propagating
35 * during the game loop.
36 */
37 class Updatable {
38
39 public:
40 virtual ~Updatable() = default;
41 Updatable() = default;
42
43 /**
44 * @brief Called each frame to update the component state.
45 *
46 * @param updateContext Context containing deltaTime, input state, and references
47 * to CommandBuffer and GameWorld.
48 */
49 virtual void update(helios::engine::runtime::world::UpdateContext& updateContext) noexcept = 0;
50 };
51
52}

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.