diff options
Diffstat (limited to 'src/timedLatch.hpp')
-rw-r--r-- | src/timedLatch.hpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/timedLatch.hpp b/src/timedLatch.hpp new file mode 100644 index 0000000..77c7d49 --- /dev/null +++ b/src/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 |