Save Manager
This commit is contained in:
32
src/dawn/time/ITimeManager.cpp
Normal file
32
src/dawn/time/ITimeManager.cpp
Normal file
@ -0,0 +1,32 @@
|
||||
// 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();
|
||||
}
|
Reference in New Issue
Block a user