33 lines
519 B
C++
33 lines
519 B
C++
#ifndef SCHEDULER_HPP
|
|
#define SCHEDULER_HPP
|
|
|
|
#include <ctime>
|
|
#include <string>
|
|
#include <vector>
|
|
#include "data.hpp"
|
|
|
|
class Timer {
|
|
public:
|
|
Timer(TimerData data) : name(data.name), max_time(data.max_time) {};
|
|
bool below_or_zero();
|
|
float get_time();
|
|
std::string get_name();
|
|
void reset();
|
|
void update();
|
|
|
|
private:
|
|
float time = 0;
|
|
const float max_time;
|
|
const std::string name;
|
|
};
|
|
|
|
struct Scheduler {
|
|
Scheduler();
|
|
std::vector<Timer> timers;
|
|
void update(bool& running);
|
|
int pull(std::string name);
|
|
};
|
|
|
|
|
|
#endif
|