-
Notifications
You must be signed in to change notification settings - Fork 1
/
game_speed.h
38 lines (26 loc) · 925 Bytes
/
game_speed.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef GAME_SPEED_H
#define GAME_SPEED_H
#include "delta_t.h"
#include <iosfwd>
#include <vector>
/// The game speed
enum class game_speed
{
slowest, slower, slow, normal, fast, faster, fastest
};
/// Get all the game_speeds
std::vector<game_speed> get_all_game_speeds() noexcept;
/// Get the default game speed
constexpr game_speed get_default_game_speed() { return game_speed::slowest; }
/// Get the next game speed,
/// i.e. when the user presses right
game_speed get_next(const game_speed speed) noexcept;
/// Get the previous game speed,
/// i.e. when the user presses left
game_speed get_previous(const game_speed speed) noexcept;
/// Test this class and its free functions
void test_game_speed();
delta_t to_delta_t(const game_speed speed) noexcept;
std::string to_str(const game_speed speed) noexcept;
std::ostream& operator<<(std::ostream& os, const game_speed speed) noexcept;
#endif // GAME_SPEED_H