Conquer Chess
Chess and Starcraft combined
Loading...
Searching...
No Matches
textures.h
Go to the documentation of this file.
1#ifndef TEXTURES_H
2#define TEXTURES_H
3
4#ifndef LOGIC_ONLY
5
6#include "chess_color.h"
7
8#include <SFML/Graphics.hpp>
9
12{
13public:
14 textures();
15
16 int get_n_textures() const noexcept { return sizeof(*this) / sizeof(m_title); };
17
19 sf::Texture& get_strip(const chess_color color) noexcept;
20
22 sf::Texture& get_square(const chess_color color) noexcept;
23
25 sf::Texture& get_subtitle() noexcept { return m_subtitle; }
26
28 sf::Texture& get_title() noexcept { return m_title; }
29
31 sf::Texture& get_occupied_square(
32 const chess_color square_color,
33 const chess_color occupant_color
34 ) noexcept;
35
38 const chess_color square_color,
39 const chess_color occupant_color
40 ) noexcept;
41
43 sf::Texture& get_semitransparent_square(const chess_color color) noexcept;
44
45private:
46
47 std::map<chess_color, std::map<chess_color, sf::Texture>> m_semitransparent_occupied_squares;
48 std::map<chess_color, std::map<chess_color, sf::Texture>> m_occupied_squares;
49 std::map<chess_color, sf::Texture> m_squares;
50 std::map<chess_color, sf::Texture> m_semitransparent_squares;
51 std::map<chess_color, sf::Texture> m_strips;
52
53 sf::Texture m_subtitle;
54 sf::Texture m_title;
55
56 std::string get_occupied_square_filename(
57 const chess_color square_color,
58 const chess_color occupant_color
59 ) const noexcept;
60
61 std::string get_occupied_square_semitransparent_filename(
62 const chess_color square_color,
63 const chess_color occupant_color
64 ) const noexcept;
65
66 std::string get_square_filename(
67 const chess_color color
68 ) const noexcept;
69
70 std::string get_square_semitransparent_filename(
71 const chess_color color
72 ) const noexcept;
73
74 std::string get_strip_filename(
75 const chess_color color
76 ) const noexcept;
77};
78
79#endif // LOGIC_ONLY
80
81#endif // TEXTURES_H
chess_color
A chess piece color.
Definition chess_color.h:10
The games' textures.
Definition textures.h:12
sf::Texture & get_subtitle() noexcept
Get the subtitle image.
Definition textures.h:25
sf::Texture & get_strip(const chess_color color) noexcept
Get a strip of chess board squares.
Definition textures.cpp:189
sf::Texture & get_square(const chess_color color) noexcept
Get a chess board square.
Definition textures.cpp:155
sf::Texture & get_title() noexcept
Get the title image.
Definition textures.h:28
int get_n_textures() const noexcept
Definition textures.h:16
sf::Texture & get_semitransparent_square(const chess_color color) noexcept
Get a semitransparent chess board square.
Definition textures.cpp:148
sf::Texture & get_occupied_square_semitransparent(const chess_color square_color, const chess_color occupant_color) noexcept
Get an occupied chess board square.
Definition textures.cpp:120
sf::Texture & get_occupied_square(const chess_color square_color, const chess_color occupant_color) noexcept
Get an occupied chess board square.
Definition textures.cpp:112
textures()
Definition textures.cpp:11