Game Engine
Architected a C++ game engine with a runtime reflection system - employing Chain of
|
A class to wrap the system clock and provide additional functionality. More...
#include <GameClock.h>
Public Types | |
using | NowFunc = std::function<std::chrono::high_resolution_clock::time_point()> |
Any function which returns a time_point. Provided for use in the debug default constructor, so that "fake" time may be maintained by the application, for use in debug code. |
Public Member Functions | |
GameClock (NowFunc now=nullptr) | |
GameClock (const GameClock &)=default | |
GameClock & | operator= (const GameClock &)=default |
GameClock (GameClock &&)=default | |
GameClock & | operator= (GameClock &&)=default |
~GameClock ()=default | |
GameTime | Current () const |
Return a GameTime struct based on the current clock time. | |
GameTime::Millis | Elapsed (const GameTime &time) const |
Given a game time struct, how much time has elapsed since it was last updated. | |
void | Update (GameTime &time) const |
Updates a game time struct, based upon the current clock time. |
A class to wrap the system clock and provide additional functionality.
using Fiea::Engine::GameClock::NowFunc = std::function<std::chrono::high_resolution_clock::time_point()> |
Any function which returns a time_point. Provided for use in the debug default constructor, so that "fake" time may be maintained by the application, for use in debug code.
Fiea::Engine::GameClock::GameClock | ( | NowFunc | now = nullptr | ) |
|
default |
|
default |
|
default |
|
nodiscard |
Return a GameTime struct based on the current clock time.
GameTime::Millis Fiea::Engine::GameClock::Elapsed | ( | const GameTime & | time | ) | const |
Given a game time struct, how much time has elapsed since it was last updated.
void Fiea::Engine::GameClock::Update | ( | GameTime & | time | ) | const |
Updates a game time struct, based upon the current clock time.