cs381/as6/components/MeterComponent.hpp

23 lines
489 B
C++

#pragma once
#include "Component.hpp"
#include <algorithm>
/**
* Stores and mutates the player's gravity meter with change events.
*/
struct MeterComponent : public Component {
float value = 60.0f;
float maxValue = 100.0f;
float drainRate = 14.0f;
float gainPerStar = 28.0f;
void Setup() override;
void SetValue(float newValue);
void AddValue(float delta);
void Drain(float amount);
void Update(float dt) override;
void Cleanup() override;
};