noffie
a89b27d456
* init rework * Update LICENSE * removing tests * adding Gui Component system * added spdlog library * Fixed input restriction bug * nothing * Making the default button stand out * Setting up run Component * changing components * restarted because i cant do it visualising sorting through value/step diagrams * g * working (kinda) * fixed sqrt comp error * added debug flag * abbandoning Lua... Error in runtime * fixing errors, making cuts * removing unnessecary dependencies * Improving UI
25 lines
437 B
C++
25 lines
437 B
C++
#pragma once
|
|
#include <chrono>
|
|
#include <functional>
|
|
|
|
class TickSystem {
|
|
private:
|
|
std::chrono::duration<float> timer{ 0 };
|
|
std::chrono::duration<float> tickRate;
|
|
|
|
public:
|
|
TickSystem(std::chrono::duration<float> tickRateSeconds)
|
|
: tickRate(tickRateSeconds) {
|
|
}
|
|
|
|
bool update(std::chrono::duration<float> deltaTime) {
|
|
timer += deltaTime;
|
|
|
|
if (timer >= tickRate) {
|
|
timer -= tickRate;
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
};
|