cs381/as6/components/StatsComponent.hpp

26 lines
572 B
C++

#pragma once
#include "Component.hpp"
#include <algorithm>
/**
* Stores persistent gameplay stats such as the gravity meter and collected stars.
*/
struct StatsComponent : public Component {
float value = 60.0f;
float maxValue = 100.0f;
float drainRate = 10.0f;
float gainPerStar = 50.0f;
int stars = 0;
void Setup() override;
void SetValue(float newValue);
void AddValue(float delta);
void Drain(float amount);
void AddStar();
int GetStarCount() const;
void Update(float dt) override;
void Cleanup() override;
};