Conquer Chess
Chess and Starcraft combined
Loading...
Searching...
No Matches
piece_textures.h
Go to the documentation of this file.
1#ifndef PIECE_TEXTURES_H
2#define PIECE_TEXTURES_H
3
4#ifndef LOGIC_ONLY
5
6#include "chess_color.h"
7#include "piece_type.h"
8#include "race.h"
9
10#include <SFML/Graphics.hpp>
11
14{
15public:
17
18 std::string get_filename(
19 const race race,
20 const chess_color color,
21 const piece_type type
22 ) const noexcept;
23
24 int get_n_textures() const noexcept
25 {
26 return sizeof(*this)
27 / sizeof(m_textures.at(race::classic).at(chess_color::white).at(piece_type::king))
28 ;
29 }
30
32 sf::Texture& get_piece(
33 const race race,
34 const chess_color color,
35 const piece_type type
36 );
37
38private:
39
40 std::map<
41 race,
42 std::map<
44 std::map<
46 sf::Texture
47 >
48 >
49 > m_textures;
50};
51
52#endif // LOGIC_ONLY
53
54#endif // TEXTURES_H
chess_color
A chess piece color.
Definition chess_color.h:10
Textures of the chess pieces.
Definition piece_textures.h:14
sf::Texture & get_piece(const race race, const chess_color color, const piece_type type)
Get texture of a piece.
Definition piece_textures.cpp:51
int get_n_textures() const noexcept
Definition piece_textures.h:24
std::string get_filename(const race race, const chess_color color, const piece_type type) const noexcept
Definition piece_textures.cpp:32
piece_textures()
Definition piece_textures.cpp:10
piece_type
The type of chess piece.
Definition piece_type.h:9
race
The chess race.
Definition race.h:10
@ classic