Conquer Chess
Chess and Starcraft combined
Loading...
Searching...
No Matches
in_game_time.h
Go to the documentation of this file.
1#ifndef IN_GAME_TIME_H
2#define IN_GAME_TIME_H
3
4#include "ccfwd.h"
5
6#include <iosfwd>
7
16{
17public:
18 explicit in_game_time(const double in_game_time);
19
20 double get() const noexcept { return m_in_game_time; }
21
22private:
23
24 double m_in_game_time;
25};
26
29
33std::string to_str(const in_game_time& t) noexcept;
34
38std::string to_human_str(const in_game_time& t) noexcept;
39
40bool operator==(const in_game_time& lhs, const in_game_time& rhs) noexcept;
41bool operator<(const in_game_time& lhs, const in_game_time& rhs) noexcept;
42bool operator<=(const in_game_time& lhs, const in_game_time& rhs) noexcept;
43bool operator>(const in_game_time& lhs, const in_game_time& rhs) noexcept;
44bool operator>=(const in_game_time& lhs, const in_game_time& rhs) noexcept;
45
46in_game_time& operator+=(in_game_time& game_time, const delta_t& dt) noexcept;
47in_game_time operator+(const in_game_time& game_time, const delta_t& dt) noexcept;
48in_game_time operator-(const in_game_time& game_time, const delta_t& dt) noexcept;
49delta_t operator-(const in_game_time& lhs, const in_game_time& rhs) noexcept;
50
51std::ostream& operator<<(std::ostream& os, const in_game_time& dt) noexcept;
52
53#endif // IN_GAME_TIME_H
A change of in_game_time}.
Definition delta_t.h:12
The in-game time, in chess moves.
Definition in_game_time.h:16
double get() const noexcept
Definition in_game_time.h:20
std::string to_human_str(const in_game_time &t) noexcept
Convert to string, rounded off to two digits.
Definition in_game_time.cpp:109
in_game_time & operator+=(in_game_time &game_time, const delta_t &dt) noexcept
Definition in_game_time.cpp:136
bool operator<(const in_game_time &lhs, const in_game_time &rhs) noexcept
Definition in_game_time.cpp:126
in_game_time operator+(const in_game_time &game_time, const delta_t &dt) noexcept
Definition in_game_time.cpp:142
bool operator>=(const in_game_time &lhs, const in_game_time &rhs) noexcept
Definition in_game_time.cpp:162
bool operator<=(const in_game_time &lhs, const in_game_time &rhs) noexcept
Definition in_game_time.cpp:131
bool operator>(const in_game_time &lhs, const in_game_time &rhs) noexcept
Definition in_game_time.cpp:157
void test_in_game_time()
Test this class and its free functions.
Definition in_game_time.cpp:16
std::string to_str(const in_game_time &t) noexcept
Convert to literal string, with all the digits behind the comma.
Definition in_game_time.cpp:116
bool operator==(const in_game_time &lhs, const in_game_time &rhs) noexcept
Definition in_game_time.cpp:121
std::ostream & operator<<(std::ostream &os, const in_game_time &dt) noexcept
Definition in_game_time.cpp:167
in_game_time operator-(const in_game_time &game_time, const delta_t &dt) noexcept
Definition in_game_time.cpp:147