Conquer Chess
Chess and Starcraft combined
Loading...
Searching...
No Matches
lobby_menu_textures.h
Go to the documentation of this file.
1#ifndef LOBBY_MENU_TEXTURES_H
2#define LOBBY_MENU_TEXTURES_H
3
4#ifndef LOGIC_ONLY
5
6#include "race.h"
7#include "chess_color.h"
8
9#include <SFML/Graphics.hpp>
10
11#include <map>
12
15{
16public:
18
20 sf::Texture& get_color(const chess_color color) noexcept;
21
22 std::string get_color_filename(
23 const chess_color race
24 ) const noexcept;
25
27 sf::Texture& get_head(const race r) noexcept;
28
29 std::string get_head_filename(
30 const race race
31 ) const noexcept;
32
34 sf::Texture& get_ready(const bool is_ready) noexcept;
35
36 std::string get_ready_filename(
37 const bool is_ready
38 ) const noexcept;
39
40 int get_n_textures() const noexcept
41 {
42 return sizeof(*this) / sizeof(m_heads.at(race::classic));
43 }
44
45private:
46
47 std::map<race, sf::Texture> m_heads;
48
49 std::map<chess_color, sf::Texture> m_color;
50
51 std::map<bool, sf::Texture> m_ready;
52
53};
54
55#endif // LOGIC_ONLY
56
57#endif // TEXTURES_H
chess_color
A chess piece color.
Definition chess_color.h:10
The textures used in the Lobby dialog.
Definition lobby_menu_textures.h:15
sf::Texture & get_head(const race r) noexcept
Get the head of a representative of the race.
Definition lobby_menu_textures.cpp:93
int get_n_textures() const noexcept
Definition lobby_menu_textures.h:40
lobby_menu_textures()
Definition lobby_menu_textures.cpp:11
std::string get_head_filename(const race race) const noexcept
Definition lobby_menu_textures.cpp:69
std::string get_color_filename(const chess_color race) const noexcept
Definition lobby_menu_textures.cpp:60
sf::Texture & get_color(const chess_color color) noexcept
Get an abstract chess color.
Definition lobby_menu_textures.cpp:53
sf::Texture & get_ready(const bool is_ready) noexcept
Get a texture to state if the person is ready yes/no.
Definition lobby_menu_textures.cpp:78
std::string get_ready_filename(const bool is_ready) const noexcept
Definition lobby_menu_textures.cpp:85
race
The chess race.
Definition race.h:10
@ classic