
#include <WFX/kernel/TimeTask.h>

using namespace WFX;
using namespace WFX::kernel;

ULong TimeTask::ThisFrame = 0;
ULong TimeTask::LastFrame = 0;
Real TimeTask::DeltaTime = 0;
Real TimeTask::FPS = 0;

TimeTask::TimeTask() {
    Priority = 10;
    DesiredFPS = -1;
    DesiredDTime = -1;
}

void TimeTask::update() {
    std::list<Timer*>::iterator it;
    //remove stopped timers
    for (it=StoppedTimers.begin();it!=StoppedTimers.end();it++) {
        Timers.remove(*it);
    }
    for (it=Timers.begin();it!=Timers.end();it++) {
        (*it)->update();
    }
}

