Save Manager
This commit is contained in:
@ -6,5 +6,5 @@
|
||||
# Sources
|
||||
target_sources(${DAWN_TARGET_NAME}
|
||||
PRIVATE
|
||||
TimeManager.cpp
|
||||
ITimeManager.cpp
|
||||
)
|
@ -3,15 +3,15 @@
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#include "TimeManager.hpp"
|
||||
#include "ITimeManager.hpp"
|
||||
|
||||
using namespace Dawn;
|
||||
|
||||
TimeManager::TimeManager() {
|
||||
ITimeManager::ITimeManager() {
|
||||
|
||||
}
|
||||
|
||||
void TimeManager::update(float_t delta) {
|
||||
void ITimeManager::update(float_t delta) {
|
||||
this->delta = delta;
|
||||
this->time += delta;
|
||||
if(!this->isPaused) {
|
||||
@ -19,13 +19,13 @@ void TimeManager::update(float_t delta) {
|
||||
}
|
||||
}
|
||||
|
||||
void TimeManager::pause() {
|
||||
void ITimeManager::pause() {
|
||||
if(this->isPaused) return;
|
||||
this->isPaused = true;
|
||||
this->eventTimePaused.invoke();
|
||||
}
|
||||
|
||||
void TimeManager::resume() {
|
||||
void ITimeManager::resume() {
|
||||
if(!this->isPaused) return;
|
||||
this->isPaused = false;
|
||||
this->eventTimeResumed.invoke();
|
@ -8,7 +8,7 @@
|
||||
#include "event/Event.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
class TimeManager {
|
||||
class ITimeManager {
|
||||
public:
|
||||
float_t time = 0.0f;
|
||||
float_t unpausedTime = 0.0f;
|
||||
@ -21,7 +21,7 @@ namespace Dawn {
|
||||
/**
|
||||
* Constructor for the Time Manager.
|
||||
*/
|
||||
TimeManager();
|
||||
ITimeManager();
|
||||
|
||||
/**
|
||||
* Updates / Ticks the time manager instance.
|
||||
@ -39,5 +39,12 @@ namespace Dawn {
|
||||
* Resumes the game.
|
||||
*/
|
||||
void resume();
|
||||
|
||||
/**
|
||||
* Returns the current system timestamp.
|
||||
*
|
||||
* @return Current timestamp.
|
||||
*/
|
||||
virtual int64_t getTimestamp() = 0;
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user