Conquer Chess
Chess and Starcraft combined
Loading...
Searching...
No Matches
Functions
game_speed.cpp File Reference
#include "game_speed.h"
#include <algorithm>
#include <cassert>
#include <iostream>
#include <sstream>
#include "../magic_enum/include/magic_enum/magic_enum.hpp"
Include dependency graph for game_speed.cpp:

Functions

std::vector< game_speedget_all_game_speeds () noexcept
 Get all the game_speeds.
 
game_speed get_next (const game_speed speed) noexcept
 Get the next game speed, i.e.
 
game_speed get_previous (const game_speed speed) noexcept
 Get the previous game speed, i.e.
 
void test_game_speed ()
 Test this class and its free functions.
 
double get_speed_multiplier (const game_speed speed) noexcept
 Convert the game speed to a speed multiplier, where game_speed::normal denotes the baseline speed of 1 chess move per second.
 
std::string to_human_str (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
 

Function Documentation

◆ get_all_game_speeds()

std::vector< game_speed > get_all_game_speeds ( )
noexcept

Get all the game_speeds.

◆ get_next()

game_speed get_next ( const game_speed  speed)
noexcept

Get the next game speed, i.e.

when the user presses right

◆ get_previous()

game_speed get_previous ( const game_speed  speed)
noexcept

Get the previous game speed, i.e.

when the user presses left

◆ get_speed_multiplier()

double get_speed_multiplier ( const game_speed  speed)
noexcept

Convert the game speed to a speed multiplier, where game_speed::normal denotes the baseline speed of 1 chess move per second.

◆ operator<<()

std::ostream & operator<< ( std::ostream &  os,
const game_speed  speed 
)
noexcept

◆ test_game_speed()

void test_game_speed ( )

Test this class and its free functions.

◆ to_human_str()

std::string to_human_str ( const game_speed  speed)
noexcept

◆ to_str()

std::string to_str ( const game_speed  speed)
noexcept