ECS component that defines the length of a drawable object.
More...
#include <wLengthComponent.hpp>
|
| LengthComponent (float length=2.0f) |
| Constructs the component with an initial positive length.
|
virtual | ~LengthComponent ()=default |
float | getLength () const |
| Returns the current length.
|
void | setLength (float newLength) |
| Sets a new length value.
|
void | debugPrint () const |
| Outputs the current length value to the console for debugging.
|
virtual | ~Component ()=default |
virtual void | enable () |
virtual void | disable () |
bool | isEnabled () const |
| Checks whether the component is currently active.
|
void | setParent (Entity *parent) |
| Sets the parent entity of this component.
|
Entity * | getParent () const |
| Returns the parent entity of this component.
|
|
| Component () |
| Protected constructor to restrict instantiation to derived classes.
|
ECS component that defines the length of a drawable object.
This component stores a positive float value representing the length (in pixels) of lines or shapes. The value must be strictly positive.
- Exceptions
-
std::invalid_argument | if the value is zero or negative. |
- Author
- Wilfried Koch
- Copyright
- © 2025 Wilfried Koch. All rights reserved.
◆ LengthComponent()
wEngine::LengthComponent::LengthComponent |
( |
float | length = 2.0f | ) |
|
Constructs the component with an initial positive length.
- Parameters
-
length | Initial length value (default is 2.0f). |
- Exceptions
-
std::invalid_argument | if the value is zero or negative. |
◆ ~LengthComponent()
virtual wEngine::LengthComponent::~LengthComponent |
( |
| ) |
|
|
virtualdefault |
◆ getLength()
float wEngine::LengthComponent::getLength |
( |
| ) |
const |
|
nodiscard |
Returns the current length.
- Returns
- A positive float representing the line length (in pixels).
◆ setLength()
void wEngine::LengthComponent::setLength |
( |
float | newLength | ) |
|
Sets a new length value.
- Parameters
-
newLength | A strictly positive float. |
- Exceptions
-
std::invalid_argument | if the value is zero or negative. |
◆ debugPrint()
void wEngine::LengthComponent::debugPrint |
( |
| ) |
const |
Outputs the current length value to the console for debugging.
The documentation for this class was generated from the following files: