sftools
2.0 dev
Bunch of tools for SFML application development
|
Provide functionalities of a chronometer, aka stop watch. More...
#include <Chronometer.hpp>
Public Member Functions | |
Chronometer (sf::Time initialTime=sf::Time::Zero) | |
Constructor. | |
sf::Time | add (sf::Time time) |
Add some time. | |
sf::Time | reset (bool start=false) |
Reset the chronometer. | |
sf::Time | pause () |
Pause the chronometer. | |
sf::Time | resume () |
Resume the chronometer. | |
sf::Time | toggle () |
Pause or resume the chronometer. | |
bool | isRunning () const |
Tell the chronometer is running or not. | |
sf::Time | getElapsedTime () const |
Give the amount of time elapsed since the chronometer was started. | |
operator sf::Time () const | |
Implicit conversion to sf::Time. | |
Provide functionalities of a chronometer, aka stop watch.
Definition at line 45 of file Chronometer.hpp.
|
inline |
Constructor.
initialTime | Initial time elapsed |
Definition at line 53 of file Chronometer.hpp.
|
inline |
Add some time.
time | Time to be added to the time elapsed |
Definition at line 65 of file Chronometer.hpp.
References getElapsedTime().
Referenced by Chronometer().
|
inline |
Give the amount of time elapsed since the chronometer was started.
Definition at line 160 of file Chronometer.hpp.
Referenced by add(), operator sf::Time(), pause(), reset(), resume(), and toggle().
|
inline |
Tell the chronometer is running or not.
chronometer's status
Definition at line 150 of file Chronometer.hpp.
|
inline |
Implicit conversion to sf::Time.
Definition at line 181 of file Chronometer.hpp.
References getElapsedTime().
|
inline |
Pause the chronometer.
Definition at line 99 of file Chronometer.hpp.
References getElapsedTime(), and isRunning().
Referenced by toggle().
|
inline |
Reset the chronometer.
start | if true the chronometer automatically starts |
Definition at line 80 of file Chronometer.hpp.
References getElapsedTime(), and resume().
Referenced by Chronometer().
|
inline |
Resume the chronometer.
Definition at line 116 of file Chronometer.hpp.
References getElapsedTime(), and isRunning().
|
inline |
Pause or resume the chronometer.
If the chronometer is running the it is paused; otherwise it is resumes.
Definition at line 137 of file Chronometer.hpp.
References getElapsedTime(), isRunning(), pause(), and resume().