diff --git a/source/util/Timer.cpp b/source/util/Timer.cpp deleted file mode 100644 index ae8cc7b..0000000 --- a/source/util/Timer.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Timer.cpp - * - * Created on: 19.10.2012 - * Author: Felix - */ - -#include "Timer.h" - -#include - -/** - * Initializes time limit to zero. - */ -Timer::Timer() { -} - -/** - * Initializes time limit to parameter value. - */ -Timer::Timer(sf::Time timeLimit) : - mLimit(timeLimit) { -} - -/** - * Returns true if the time set in setLimit() has passed since calling start(). - */ -bool -Timer::isExpired() const { - return mClock.getElapsedTime() >= mLimit; -} - -/** - * Starts the timer. - */ -void -Timer::start() { - mClock.restart(); -} - -/** - * Sets the time limit to run to. - */ -void -Timer::setLimit(sf::Time timeLimit) { - assert(timeLimit > sf::Time::Zero); - mLimit = timeLimit; -} diff --git a/source/util/Timer.h b/source/util/Timer.h deleted file mode 100644 index 529b5fa..0000000 --- a/source/util/Timer.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Timer.h - * - * Created on: 19.10.2012 - * Author: Felix - */ - -#ifndef DG_TIMER_H_ -#define DG_TIMER_H_ - -#include - -/** - * 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_ */