diff options
author | Stephen Enders <smenders@gmail.com> | 2021-01-20 21:05:44 -0500 |
---|---|---|
committer | Stephen Enders <smenders@gmail.com> | 2021-01-20 21:05:44 -0500 |
commit | eccb6df404b9ae052b9d13750f54dc69241668b4 (patch) | |
tree | ec4c52c55c021a4550723f2fe8fd6dce8c118ac2 /timedLatch.hpp | |
parent | 1f8159534f30d3e46f53cebb788c91153103edcb (diff) |
Create timer and use it to end the rolling phase
This timer can be used to determine when to end rolling
Diffstat (limited to 'timedLatch.hpp')
-rw-r--r-- | timedLatch.hpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/timedLatch.hpp b/timedLatch.hpp new file mode 100644 index 0000000..77c7d49 --- /dev/null +++ b/timedLatch.hpp @@ -0,0 +1,22 @@ +#ifndef UR_TIMEDLATCH_H +#define UR_TIMEDLATCH_H +#include <SFML/System.hpp> + +namespace ur { +class TimedLatch +{ +public: + TimedLatch(sf::Time duration); + void start(); + void reset(); + bool is_running(); + bool is_completed(); + +private: + bool isStarted; + sf::Time duration; + sf::Clock clock; // internal sfml clock to manage time +}; +} + +#endif |