This repository has been archived on 2019-12-07. You can view files and clone it, but cannot push or open issues or pull requests.
dungeon-gunner/source/util/Timer.h
2012-10-19 15:44:45 +02:00

34 lines
560 B
C++

/*
* Timer.h
*
* Created on: 19.10.2012
* Author: Felix
*/
#ifndef DG_TIMER_H_
#define DG_TIMER_H_
#include <SFML/System.hpp>
/**
* A small timer utility that allows testing whether a certain amount of time is over.
*
* Replacement for thor::Timer as it causes crashes.
*/
class Timer {
// Public functions.
public:
Timer();
Timer(sf::Time timeLimit);
void start();
void setLimit(sf::Time timeLimit);
bool isExpired() const;
// Private variables.
private:
sf::Clock mClock;
sf::Time mLimit;
};
#endif /* DG_TIMER_H_ */