Skip to main content

Move2DConfig.ixx File

Configuration for 2D movement components. More...

Included Headers

Namespaces Index

namespacehelios
namespaceengine

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

namespacebuilder

Fluent builder pattern for constructing GameObjects. More...

namespacegameObject

Factory and prototype classes for GameObject construction. More...

namespacebuilders

Domain-specific builders for configuring different aspects of GameObjects. More...

namespaceconfigs

Fine-grained configuration classes for component setup. More...

Classes Index

classMove2DConfig

Fluent configuration for 2D movement behavior. More...

Description

Configuration for 2D movement components.

File Listing

The file content with the documentation metadata removed is:

1/**
2 * @file Move2DConfig.ixx
3 * @brief Configuration for 2D movement components.
4 */
5module;
6
7export module helios.engine.builder.gameObject.builders.configs.Move2DConfig;
8
9import helios.engine.ecs.GameObject;
10import helios.engine.modules.physics;
11import helios.engine.modules.spatial;
12
14
15 /**
16 * @brief Fluent configuration for 2D movement behavior.
17 *
18 * Automatically adds required components:
19 * - Move2DComponent
20 * - ComposeTransformComponent
21 * - DirectionComponent
22 * - TranslationStateComponent
23 */
25
26 /**
27 * @brief Non-owning pointer to the target GameObject.
28 */
30
31 public:
32
33 /**
34 * @brief Constructs a Move2DConfig and adds required components.
35 *
36 * @param gameObject Target GameObject to configure.
37 */
39
41
45
46 }
47
48 /**
49 * @brief Sets the maximum movement speed.
50 *
51 * @param movementSpeed Speed in units per second.
52 *
53 * @return Reference to this config for chaining.
54 */
55 Move2DConfig& speed(const float movementSpeed) {
57 ->setMovementSpeed(movementSpeed);
58
59 return *this;
60 }
61
62 /**
63 * @brief Sets the movement acceleration rate.
64 *
65 * @param movementAcceleration Acceleration in units per second squared.
66 *
67 * @return Reference to this config for chaining.
68 */
69 Move2DConfig& acceleration(const float movementAcceleration) {
71 ->setMovementAcceleration(movementAcceleration);
72
73 return *this;
74 }
75
76 /**
77 * @brief Enables or disables instant acceleration.
78 *
79 * When enabled, the entity reaches max speed immediately.
80 *
81 * @param useInstantAcceleration True for instant acceleration.
82 *
83 * @return Reference to this config for chaining.
84 */
85 Move2DConfig& instantAcceleration(const bool useInstantAcceleration) {
87 ->setUseInstantAcceleration(useInstantAcceleration);
88
89 return *this;
90 }
91
92 };
93
94}
95

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.