Conquer Chess
Chess and Starcraft combined
Loading...
Searching...
No Matches
lobby_options.h
Go to the documentation of this file.
1#ifndef LOBBY_OPTIONS_H
2#define LOBBY_OPTIONS_H
3
4#include "chess_color.h"
5#include "race.h"
6#include "side.h"
7
8#include <iosfwd>
9#include <map>
10
16{
17public:
19 const chess_color lhs_color = chess_color::white,
20 const race lhs_race = race::classic,
21 const race rhs_race = race::classic
22 );
23
25 chess_color get_color(const side player_side) const noexcept;
26
28 race get_race(const chess_color player_color) const noexcept;
29
31 race get_race(const side player_side) const noexcept;
32
34 side get_side(const chess_color player_color) const noexcept;
35
37 void set_color(const chess_color color, const side player_side) noexcept;
38
40 void set_race(const race r, const side player_side) noexcept;
41
42private:
43
44
48 std::map<side, chess_color> m_color;
49
51 std::map<side, race> m_race;
52
54 friend void test_lobby_options();
55};
56
59
60std::ostream& operator<<(std::ostream& os, const lobby_options& options) noexcept;
61
62#endif // LOBBY_OPTIONS_H
chess_color
A chess piece color.
Definition chess_color.h:10
The options that are set in the lobby.
Definition lobby_options.h:16
chess_color get_color(const side player_side) const noexcept
Get the chess color of a player.
Definition lobby_options.cpp:19
void set_race(const race r, const side player_side) noexcept
Get the chess color of a player.
Definition lobby_options.cpp:49
void set_color(const chess_color color, const side player_side) noexcept
Set the chess color of a player.
Definition lobby_options.cpp:43
friend void test_lobby_options()
To use the constructor.
Definition lobby_options.cpp:54
side get_side(const chess_color player_color) const noexcept
Get the side of a player color.
Definition lobby_options.cpp:36
race get_race(const chess_color player_color) const noexcept
Get the race of a player color.
Definition lobby_options.cpp:24
std::ostream & operator<<(std::ostream &os, const lobby_options &options) noexcept
Definition lobby_options.cpp:164
void test_lobby_options()
Test this class and its free functions.
Definition lobby_options.cpp:54
race
The chess race.
Definition race.h:10
@ classic
side
The side the player/piece is on.
Definition side.h:11