32 lines
616 B
C++
32 lines
616 B
C++
// Copyright (c) 2022 Dominic Masters
|
|
//
|
|
// This software is released under the MIT License.
|
|
// https://opensource.org/licenses/MIT
|
|
|
|
#include "ITimeManager.hpp"
|
|
|
|
using namespace Dawn;
|
|
|
|
ITimeManager::ITimeManager() {
|
|
|
|
}
|
|
|
|
void ITimeManager::update(float_t delta) {
|
|
this->delta = delta;
|
|
this->time += delta;
|
|
if(!this->isPaused) {
|
|
this->unpausedTime += delta;
|
|
}
|
|
}
|
|
|
|
void ITimeManager::pause() {
|
|
if(this->isPaused) return;
|
|
this->isPaused = true;
|
|
this->eventTimePaused.invoke();
|
|
}
|
|
|
|
void ITimeManager::resume() {
|
|
if(!this->isPaused) return;
|
|
this->isPaused = false;
|
|
this->eventTimeResumed.invoke();
|
|
} |