42 explicit HealthBarSystem(
const std::shared_ptr<eng::IRenderer> &renderer);
118 void drawHealthBar(
float x,
float y,
float currentHealth,
float maxHealth);
This file contains the IRenderer class declaration.
This file contains the interface for systems.
This file contains the Registry class declaration.
Abstract class for system.
Class for managing entities and their components.
ECS System that renders dynamic health bars above entities.
static constexpr float BAR_WIDTH
Width of the health bar in pixels.
~HealthBarSystem() override=default
Destructor.
static constexpr eng::Color HEALTH_HIGH
Green color for >75% health.
static constexpr eng::Color BORDER
White border color.
static constexpr float BAR_HEIGHT
Height of the health bar in pixels.
HealthBarSystem & operator=(const HealthBarSystem &)=delete
Deleted copy assignment operator (non-copyable)
void update(ecs::Registry ®istry, float dt) override
Update the health bar system (called each frame)
void drawHealthBar(float x, float y, float currentHealth, float maxHealth)
Render a health bar at specified position.
static constexpr eng::Color HEALTH_CRITICAL
Red color for <25% health.
eng::Color getHealthColor(float healthPercent) const
Calculate health bar color based on health percentage.
static constexpr float BAR_OFFSET_Y
Vertical offset above entity (negative = above)
HealthBarSystem & operator=(HealthBarSystem &&)=delete
Deleted move assignment operator (non-movable)
HealthBarSystem(const HealthBarSystem &)=delete
Deleted copy constructor (non-copyable)
static constexpr eng::Color HEALTH_MEDIUM
Yellow color for 50-75% health.
static constexpr eng::Color HEALTH_LOW
Orange color for 25-50% health.
HealthBarSystem(const std::shared_ptr< eng::IRenderer > &renderer)
Constructor.
HealthBarSystem(HealthBarSystem &&)=delete
Deleted move constructor (non-movable)
static constexpr eng::Color BACKGROUND
Dark gray background (semi-transparent)
const std::shared_ptr< eng::IRenderer > & m_renderer
Reference to the renderer for drawing.
static constexpr float BORDER_THICKNESS
Thickness of the border around the bar.