SimulationCraft
SimulationCraft is a tool to explore combat mechanics in the popular MMO RPG World of Warcraft (tm).
simc::timespan_t Class Reference

Class for representing InGame time. More...

#include <timespan.hpp>

Public Types

using native_t = time_t
 

Public Member Functions

constexpr double total_minutes () const
 
constexpr double total_seconds () const
 
constexpr time_t total_millis () const
 
constexpr bool operator== (timespan_t right) const
 
constexpr bool operator!= (timespan_t right) const
 
constexpr bool operator> (timespan_t right) const
 
constexpr bool operator>= (timespan_t right) const
 
constexpr bool operator< (timespan_t right) const
 
constexpr bool operator<= (timespan_t right) const
 
constexpr timespan_toperator+= (timespan_t right)
 
constexpr timespan_toperator-= (timespan_t right)
 
constexpr timespan_toperator%= (timespan_t right)
 
template<typename Rep , typename = std::enable_if_t<std::is_arithmetic<Rep>::value>>
constexpr timespan_toperator*= (Rep right)
 
template<typename Rep , typename = std::enable_if_t<std::is_arithmetic<Rep>::value>>
constexpr timespan_toperator/= (Rep right)
 

Static Public Member Functions

template<typename Rep , typename = std::enable_if_t<std::is_arithmetic<Rep>::value>>
static constexpr timespan_t from_millis (Rep millis)
 
template<typename Rep , typename = std::enable_if_t<std::is_arithmetic<Rep>::value>>
static constexpr timespan_t from_seconds (Rep seconds)
 
template<typename Rep , typename = std::enable_if_t<std::is_arithmetic<Rep>::value>>
static constexpr timespan_t from_minutes (Rep minutes)
 
static constexpr native_t to_native (timespan_t t)
 
template<typename Rep >
static constexpr timespan_t from_native (Rep t)
 
static constexpr timespan_t zero ()
 
static constexpr timespan_t max ()
 
static constexpr timespan_t min ()
 

Friends

constexpr timespan_t operator+ (timespan_t right)
 
constexpr timespan_t operator- (timespan_t right)
 
constexpr timespan_t operator+ (timespan_t left, timespan_t right)
 
constexpr timespan_t operator- (timespan_t left, timespan_t right)
 
template<typename Rep >
constexpr auto operator* (timespan_t left, Rep right) -> std::enable_if_t< std::is_arithmetic< Rep >::value, timespan_t >
 
template<typename Rep >
constexpr auto operator* (Rep left, timespan_t right) -> std::enable_if_t< std::is_arithmetic< Rep >::value, timespan_t >
 
template<typename Rep >
constexpr auto operator/ (timespan_t left, Rep right) -> std::enable_if_t< std::is_arithmetic< Rep >::value, timespan_t >
 
constexpr double operator/ (timespan_t left, timespan_t right)
 
constexpr timespan_t operator% (timespan_t left, timespan_t right)
 
void sc_format_to (timespan_t, fmt::format_context::iterator)
 

Detailed Description

Class for representing InGame time.

World of Warcraft handles InGame time/events in milliseconds. This class emulates that format for exactness, as well as representing C++ type-safety when defining time values, without implicit conversion from or to any integral or floating numbers.