Conquer Chess
Chess and Starcraft combined
Loading...
Searching...
No Matches
input_prompt_textures.h
Go to the documentation of this file.
1#ifndef INPUT_PROMPT_TEXTURES_H
2#define INPUT_PROMPT_TEXTURES_H
3
4#ifndef LOGIC_ONLY
5
6#include <SFML/Graphics.hpp>
7
8#include <map>
9
12{
13public:
15
17 bool has_texture(const std::string& s) const noexcept;
18
20 sf::Texture& get_inverted_texture(const sf::Keyboard::Key& k);
21
29 sf::Texture& get_texture(const std::string& s);
30
32 sf::Texture& get_texture(const sf::Keyboard::Key& k);
33
35 sf::Texture& get_texture(const sf::Mouse::Button& b);
36
37 int get_n_textures() const noexcept
38 {
39 return sizeof(*this) / sizeof(*m_textures.begin());
40 }
41
42private:
43
44
45 std::map<std::string, sf::Texture> m_textures;
46
47};
48
49std::vector<std::string> read_texture_names(const std::string& filename);
50
51#endif // LOGIC_ONLY
52
53#endif // TEXTURES_H
The textures used in the Lobby dialog.
Definition input_prompt_textures.h:12
bool has_texture(const std::string &s) const noexcept
Determine if a texture is present.
Definition input_prompt_textures.cpp:61
input_prompt_textures()
Definition input_prompt_textures.cpp:13
sf::Texture & get_texture(const std::string &s)
Get a texture from a std::string.
Definition input_prompt_textures.cpp:81
int get_n_textures() const noexcept
Definition input_prompt_textures.h:37
sf::Texture & get_inverted_texture(const sf::Keyboard::Key &k)
Get an inverted texture from an SFML key.
Definition input_prompt_textures.cpp:66
std::vector< std::string > read_texture_names(const std::string &filename)
Definition input_prompt_textures.cpp:87