Game Engine
Architected a C++ game engine with a runtime reflection system - employing Chain of
Loading...
Searching...
No Matches
Fiea::Engine::GameClock Class Referencefinal

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
GameClockoperator= (const GameClock &)=default
 GameClock (GameClock &&)=default
GameClockoperator= (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.

Detailed Description

A class to wrap the system clock and provide additional functionality.

Member Typedef Documentation

◆ NowFunc

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.

Constructor & Destructor Documentation

◆ GameClock() [1/3]

Fiea::Engine::GameClock::GameClock ( NowFunc now = nullptr)
Here is the caller graph for this function:

◆ GameClock() [2/3]

Fiea::Engine::GameClock::GameClock ( const GameClock & )
default
Here is the call graph for this function:

◆ GameClock() [3/3]

Fiea::Engine::GameClock::GameClock ( GameClock && )
default
Here is the call graph for this function:

◆ ~GameClock()

Fiea::Engine::GameClock::~GameClock ( )
default

Member Function Documentation

◆ Current()

GameTime Fiea::Engine::GameClock::Current ( ) const
nodiscard

Return a GameTime struct based on the current clock time.

Returns
a game time struct
Here is the caller graph for this function:

◆ Elapsed()

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.

Here is the caller graph for this function:

◆ operator=() [1/2]

GameClock & Fiea::Engine::GameClock::operator= ( const GameClock & )
default
Here is the call graph for this function:

◆ operator=() [2/2]

GameClock & Fiea::Engine::GameClock::operator= ( GameClock && )
default
Here is the call graph for this function:

◆ Update()

void Fiea::Engine::GameClock::Update ( GameTime & time) const

Updates a game time struct, based upon the current clock time.

Here is the caller graph for this function:

The documentation for this class was generated from the following files: