MAGE  v0.171.0
Matthias Advanced Game Engine
mage::GameTime Class Reference

#include <game_timer.hpp>

Public Member Functions

constexpr GameTime () noexcept
 
constexpr GameTime (TimeIntervalSeconds wall_clock_delta_time, TimeIntervalSeconds wall_clock_total_delta_time, TimeIntervalSeconds core_clock_delta_time, TimeIntervalSeconds core_clock_total_delta_time) noexcept
 
constexpr GameTime (const GameTime &time) noexcept=default
 
constexpr GameTime (GameTime &&time) noexcept=default
 
 ~GameTime ()=default
 
GameTimeoperator= (const GameTime &time) noexcept=default
 
GameTimeoperator= (GameTime &&time) noexcept=default
 
constexpr TimeIntervalSeconds GetWallClockDeltaTime () const noexcept
 
constexpr TimeIntervalSeconds GetWallClockTotalDeltaTime () const noexcept
 
constexpr TimeIntervalSeconds GetCoreClockDeltaTime () const noexcept
 
constexpr TimeIntervalSeconds GetCoreClockTotalDeltaTime () const noexcept
 

Private Attributes

TimeIntervalSeconds m_wall_clock_delta_time
 
TimeIntervalSeconds m_wall_clock_total_delta_time
 
TimeIntervalSeconds m_core_clock_delta_time
 
TimeIntervalSeconds m_core_clock_total_delta_time
 

Detailed Description

A class of game times.

Constructor & Destructor Documentation

◆ GameTime() [1/4]

constexpr mage::GameTime::GameTime ( )
noexcept

Constructs a game time.

◆ GameTime() [2/4]

constexpr mage::GameTime::GameTime ( TimeIntervalSeconds  wall_clock_delta_time,
TimeIntervalSeconds  wall_clock_total_delta_time,
TimeIntervalSeconds  core_clock_delta_time,
TimeIntervalSeconds  core_clock_total_delta_time 
)
explicitnoexcept

Constructs a game time.

Parameters
[in]wall_clock_delta_timeThe wall clock delta time (in seconds).
[in]wall_clock_total_delta_timeThe wall clock total delta time (in seconds).
[in]core_clock_delta_timeThe core clock delta time (in seconds).
[in]core_clock_total_delta_timeThe core clock total delta time (in seconds).

◆ GameTime() [3/4]

constexpr mage::GameTime::GameTime ( const GameTime time)
defaultnoexcept

Constructs a game time from the given game time.

Parameters
[in]timeA reference to the game time to copy.

◆ GameTime() [4/4]

constexpr mage::GameTime::GameTime ( GameTime &&  time)
defaultnoexcept

Constructs a game time by moving the given game time.

Parameters
[in]timeA reference to the game time to move.

◆ ~GameTime()

mage::GameTime::~GameTime ( )
default

Destructs this game time.

Member Function Documentation

◆ GetCoreClockDeltaTime()

constexpr TimeIntervalSeconds mage::GameTime::GetCoreClockDeltaTime ( ) const
noexcept

Returns the core clock delta time (in seconds) of this game time.

Returns
The core clock delta time (in seconds) of this game time.

◆ GetCoreClockTotalDeltaTime()

constexpr TimeIntervalSeconds mage::GameTime::GetCoreClockTotalDeltaTime ( ) const
noexcept

Returns the core clock total delta time (in seconds) of this game time.

Returns
The core clock total delta time (in seconds) of this game time.

◆ GetWallClockDeltaTime()

constexpr TimeIntervalSeconds mage::GameTime::GetWallClockDeltaTime ( ) const
noexcept

Returns the wall clock delta time (in seconds) of this game time.

Returns
The wall clock delta time (in seconds) of this game time.

◆ GetWallClockTotalDeltaTime()

constexpr TimeIntervalSeconds mage::GameTime::GetWallClockTotalDeltaTime ( ) const
noexcept

Returns the wall clock total delta time (in seconds) of this game time.

Returns
The wall clock total delta time (in seconds) of this game time.

◆ operator=() [1/2]

GameTime& mage::GameTime::operator= ( const GameTime time)
defaultnoexcept

Copies the given game time to this game time.

Parameters
[in]timeA reference to the game time to copy.
Returns
A reference to the copy of the given game time (i.e. this game time).

◆ operator=() [2/2]

GameTime& mage::GameTime::operator= ( GameTime &&  time)
defaultnoexcept

Moves the given game time to this game time.

Parameters
[in]timeA reference to the game time to move.
Returns
A reference to the moved game time (i.e. this game time).

Member Data Documentation

◆ m_core_clock_delta_time

TimeIntervalSeconds mage::GameTime::m_core_clock_delta_time
private

The core clock delta time (in seconds) of this game time.

◆ m_core_clock_total_delta_time

TimeIntervalSeconds mage::GameTime::m_core_clock_total_delta_time
private

The core clock total delta time (in seconds) of this game time.

◆ m_wall_clock_delta_time

TimeIntervalSeconds mage::GameTime::m_wall_clock_delta_time
private

The wall clock delta time (in seconds) of this game time.

◆ m_wall_clock_total_delta_time

TimeIntervalSeconds mage::GameTime::m_wall_clock_total_delta_time
private

The wall clock total delta time (in seconds) of this game time.