Conquer Chess
Chess and Starcraft combined
Loading...
Searching...
No Matches
game_resources.h
Go to the documentation of this file.
1#ifndef GAME_RESOURCES_H
2#define GAME_RESOURCES_H
3
4#ifndef LOGIC_ONLY
5
6#include "artwork_textures.h"
8#include "chess_color.h"
9#include "fonts.h"
10#include "lobby_menu_textures.h"
15#include "map_textures.h"
16#include "message.h"
20#include "piece_textures.h"
21#include "piece_type.h"
22#include "piece_action_type.h"
23#include "songs.h"
24#include "sound_effects.h"
25#include "textures.h"
26#include "themba_textures.h"
28#include <optional>
29
30
31
39{
40public:
41
47 static auto& get(){
48 static game_resources r;
49 return r;
50 }
51
53
55
56 fonts& get_fonts() noexcept;
57
59
60 int get_n_fonts() noexcept;
61 int get_n_artwork_textures() noexcept;
62 int get_n_board_game_textures() noexcept;
63 int get_n_input_prompt_textures() noexcept;
64 int get_n_loading_screen_fonts() noexcept;
65 int get_n_loading_screen_songs() noexcept;
66 int get_n_loading_screen_textures() noexcept;
67 int get_n_lobby_menu_textures() noexcept;
68 int get_n_map_textures() noexcept;
69 int get_n_options_menu_textures() noexcept;
71 int get_n_piece_action_textures() noexcept;
72 int get_n_piece_portrait_textures() noexcept;
73 int get_n_piece_textures() noexcept;
74 int get_n_songs() noexcept;
75 int get_n_sound_effects() noexcept;
76 int get_n_themba_textures() noexcept;
77 int get_n_textures() noexcept;
78
80
82
84
86
88
90
92
94
96
98
99 songs& get_songs() noexcept;
100
102
103 textures& get_textures() noexcept;
104
106
107private:
108
111
112 static std::optional<artwork_textures> m_artwork_textures;
113 static std::optional<board_game_textures> m_board_game_textures;
114 static std::optional<fonts> m_fonts;
115 static std::optional<loading_screen_fonts> m_loading_screen_fonts;
116 static std::optional<input_prompt_textures> m_input_prompt_textures;
117 static loading_screen_songs * m_loading_screen_songs;
118 static std::optional<loading_screen_textures> m_loading_screen_textures;
119 static std::optional<lobby_menu_textures> m_lobby_menu_textures;
120 static std::optional<map_textures> m_map_textures;
121 static std::optional<options_menu_textures> m_options_menu_textures;
122 static std::optional<physical_controller_textures> m_physical_controller_type_textures;
123 static std::optional<piece_action_textures> m_piece_action_textures;
124 static std::optional<piece_portrait_textures> m_piece_portrait_textures;
125 static std::optional<piece_textures> m_piece_textures;
126 static songs * m_songs;
127 static sound_effects * m_sound_effects;
128 static std::optional<textures> m_textures;
129 static std::optional<themba_textures> m_themba_textures;
130};
131
132
133sf::Texture& get_about_texture() noexcept;
134
135sf::Texture& get_action_icon(
137) noexcept;
138
140sf::Font& get_arial_font() noexcept;
141
143sf::Font& get_code_squared_font() noexcept;
144
147sf::Texture& get_game_option_icon(
148 const options_view_item item
149) noexcept;
150
151
152sf::Texture& get_options_texture(game_resources& r) noexcept;
153
155sf::Texture& get_piece_texture(
156 const race r,
157 const chess_color color,
158 const piece_type type
159);
160
162sf::Texture& get_piece_portrait_texture(
163 const race r,
164 const chess_color color,
165 const piece_type type
166);
167
168sf::Texture& get_quit_texture(game_resources& r) noexcept;
169
171sf::Texture& get_map_texture(
172 const race r
173) noexcept;
174
175sf::Texture& get_start_texture() noexcept;
176
177sf::Texture& get_strip_texture(const chess_color c) noexcept;
178sf::Texture& get_subtitle_texture() noexcept;
179sf::Texture& get_title_texture() noexcept;
180
182void play_sound_effect(const message& effect);
183
184#endif // LOGIC_ONLY
185
186#endif // GAME_RESOURCES_H
chess_color
A chess piece color.
Definition chess_color.h:10
The textures for the game maps.
Definition artwork_textures.h:10
The textures for the game maps.
Definition board_game_textures.h:13
The fonts used by this game.
Definition fonts.h:10
Definition game_resources.h:39
piece_portrait_textures & get_piece_portrait_textures() noexcept
Definition game_resources.cpp:261
physical_controller_textures & get_physical_controller_textures() noexcept
Definition game_resources.cpp:246
game_resources(const game_resources &)=delete
This class is a Singleton.
int get_n_piece_portrait_textures() noexcept
Definition game_resources.cpp:197
map_textures & get_map_textures() noexcept
Definition game_resources.cpp:135
piece_action_textures & get_piece_action_textures() noexcept
Definition game_resources.cpp:254
songs & get_songs() noexcept
Definition game_resources.cpp:275
int get_n_input_prompt_textures() noexcept
Definition game_resources.cpp:152
game_resources(game_resources &&)=delete
textures & get_textures() noexcept
Definition game_resources.cpp:292
themba_textures & get_themba_textures() noexcept
Definition game_resources.cpp:299
int get_n_themba_textures() noexcept
Definition game_resources.cpp:222
loading_screen_songs & get_loading_screen_songs() noexcept
Definition game_resources.cpp:112
int get_n_piece_action_textures() noexcept
Definition game_resources.cpp:192
int get_n_lobby_menu_textures() noexcept
Definition game_resources.cpp:157
int get_n_loading_screen_textures() noexcept
Definition game_resources.cpp:177
game_resources & operator=(const game_resources &)=delete
int get_n_loading_screen_songs() noexcept
Definition game_resources.cpp:172
static auto & get()
Definition game_resources.h:47
int get_n_piece_textures() noexcept
Definition game_resources.cpp:202
int get_n_fonts() noexcept
Definition game_resources.cpp:100
loading_screen_fonts & get_loading_screen_fonts() noexcept
Definition game_resources.cpp:105
lobby_menu_textures & get_lobby_menu_textures() noexcept
Definition game_resources.cpp:86
int get_n_board_game_textures() noexcept
Definition game_resources.cpp:147
artwork_textures & get_artwork_textures() noexcept
Definition game_resources.cpp:45
sound_effects & get_sound_effects() noexcept
Definition game_resources.cpp:285
int get_n_textures() noexcept
Definition game_resources.cpp:217
int get_n_loading_screen_fonts() noexcept
Definition game_resources.cpp:167
int get_n_songs() noexcept
Definition game_resources.cpp:207
game_resources & operator=(game_resources &&)=delete
fonts & get_fonts() noexcept
Definition game_resources.cpp:64
input_prompt_textures & get_input_prompt_textures() noexcept
Definition game_resources.cpp:79
board_game_textures & get_board_game_textures() noexcept
Definition game_resources.cpp:52
piece_textures & get_piece_textures() noexcept
Definition game_resources.cpp:268
loading_screen_textures & get_loading_screen_textures() noexcept
Definition game_resources.cpp:122
int get_n_options_menu_textures() noexcept
Definition game_resources.cpp:162
int get_n_sound_effects() noexcept
Definition game_resources.cpp:212
int get_n_map_textures() noexcept
Definition game_resources.cpp:182
int get_n_physical_controller_type_textures() noexcept
Definition game_resources.cpp:187
options_menu_textures & get_options_menu_textures() noexcept
Definition game_resources.cpp:93
int get_n_artwork_textures() noexcept
Definition game_resources.cpp:142
The textures used in the Lobby dialog.
Definition input_prompt_textures.h:12
The fonts used in the loading screen.
Definition loading_screen_fonts.h:8
The songs used in the loading screen.
Definition loading_screen_songs.h:8
The textures used in the loading screen.
Definition loading_screen_textures.h:15
The textures used in the Lobby dialog.
Definition lobby_menu_textures.h:15
The textures for the game maps.
Definition map_textures.h:12
A message.
Definition message.h:15
Textures in the Options menu.
Definition options_menu_textures.h:12
The textures used in the Lobby dialog.
Definition physical_controller_textures.h:14
The textures for piece actions.
Definition piece_action_textures.h:12
The textures of the portraits.
Definition piece_portrait_textures.h:14
Textures of the chess pieces.
Definition piece_textures.h:14
All songs.
Definition songs.h:10
The sound effects.
Definition sound_effects.h:14
The games' textures.
Definition textures.h:12
Themba Textures.
Definition themba_textures.h:10
sf::Texture & get_start_texture() noexcept
sf::Texture & get_title_texture() noexcept
Definition game_resources.cpp:316
void play_sound_effect(const message &effect)
Play a sound effect.
Definition game_resources.cpp:321
sf::Texture & get_subtitle_texture() noexcept
Definition game_resources.cpp:311
sf::Texture & get_map_texture(const race r) noexcept
Get the map for a race.
Definition game_resources.cpp:129
sf::Texture & get_quit_texture(game_resources &r) noexcept
sf::Texture & get_action_icon(piece_action_type t) noexcept
Definition game_resources.cpp:33
sf::Texture & get_piece_texture(const race r, const chess_color color, const piece_type type)
Get texture of a piece.
Definition game_resources.cpp:227
sf::Texture & get_strip_texture(const chess_color c) noexcept
Definition game_resources.cpp:306
sf::Texture & get_options_texture(game_resources &r) noexcept
sf::Texture & get_about_texture() noexcept
sf::Texture & get_game_option_icon(const options_view_item item) noexcept
Get an icon that accompanies a game option, to be used in the Options screen.
Definition game_resources.cpp:72
sf::Texture & get_piece_portrait_texture(const race r, const chess_color color, const piece_type type)
Get texture of a portrait of a piece.
Definition game_resources.cpp:236
sf::Font & get_code_squared_font() noexcept
Get the Code Squared font.
Definition game_resources.cpp:59
sf::Font & get_arial_font() noexcept
Get the Arial font.
Definition game_resources.cpp:40
options_view_item
A selectable item at in the Options menu.
Definition options_view_item.h:12
piece_action_type
The type of actions a piece can do.
Definition piece_action_type.h:9
piece_type
The type of chess piece.
Definition piece_type.h:9
race
The chess race.
Definition race.h:10