21 _msg =
"Error: The ip you provided '";
23 _msg +=
"' is incorrect.";
24 _buffer = _msg.c_str();
36 _msg =
"Error: The port you provided '";
38 _msg +=
"' is incorrect.";
39 _buffer = _msg.c_str();
51 _msg =
"Error: The configuration you provided for the font '" + fontName +
"' is incorrect.\n";
52 _msg +=
"Below is a crude explanation of the structure, for more detailed information, please refer to the online documentation at: https://rtype.pingpal.news\n";
53 _msg +=
"You provided:\n" + userConfiguration +
"\n";
54 _msg +=
"When the following structure was expected:\n";
55 _msg +=
"[<font_name>] (this is the loaded version, in the file it should be [font.<font_name>]) : the name of the font (unique identifier)\n";
56 _msg +=
"name = \"<name of the font>\" : set the name of the font (a human readable name)\n";
57 _msg +=
"path = \"<path to the font file>\" : set the path to the file (supported format, ttf, otf [and other SFML Font supported formats])\n";
58 _msg +=
"default_size = <size> : (0 to 100) set the default size of the font to display, in pixels.\n";
59 _msg +=
"bold = false : (or true) set the font to bold.\n";
60 _msg +=
"italic = false : (or true) set the font to italic\n";
61 _buffer = _msg.c_str();
73 _msg =
"Error: The configuration you provided for the music '" + musicName +
"' is incorrect.\n";
74 _msg +=
"Below is a crude explanation of the structure, for more detailed information, please refer to the online documentation at: https://rtype.pingpal.news\n";
75 _msg +=
"You provided:\n" + userConfiguration +
"\n";
76 _msg +=
"When the following structure was expected:\n";
77 _msg +=
"[<music_name>] (this is the loaded version, in the file it should be [music.<music_name>]) : the name of the music (unique identifier)\n";
78 _msg +=
"name = \"<name of the music>\" : set the name of the music (a human readable name).\n";
79 _msg +=
"path = \"<valid path to the audio file>\" : set the path to the file (supported format, ogg, wav [and other SFML Music supported formats]).\n";
80 _msg +=
"loop = true : (or false) # play the music on repeat.\n";
81 _msg +=
"volume = <volume> : (0 to 100) set the volume of the track to play.\n";
82 _buffer = _msg.c_str();
94 _msg =
"Error: The configuration you provided for the sprite '" + spriteName +
"' is incorrect.\n";
95 _msg +=
"Below is a crude explanation of the structure, for more detailed information, please refer to the online documentation at: https://rtype.pingpal.news\n";
96 _msg +=
"You provided:\n" + userConfiguration +
"\n";
97 if (!exceptionDetail.empty()) {
98 _msg +=
"Additional details about the error: (" + exceptionDetail +
")\n";
100 _msg +=
"When the following structure was expected:\n";
101 _msg +=
"[<spritesheet_name>] (this is the loaded version, in the file it should be [spritesheet.<spritesheet_name>]) : the name of the spritesheet (unique identifier)\n";
102 _msg +=
"name = \"<name of the sprite>\" : set the name of the sprite (a human readable name).\n";
103 _msg +=
"path = \"<valid path to the image file>\" : set the path to the file (supported format, gif, png [and other SFML Texture supported formats]).\n";
104 _msg +=
"sprite_width = <width> : (0 to 1000) set the width of the sprite view field, in pixels.\n";
105 _msg +=
"sprite_height = <height> : (0 to 1000) set the height of the sprite view field, in pixels.\n";
106 _msg +=
"start_left = true : (or false) set the starting position of the sprite view field to start from the left (or not).\n";
107 _msg +=
"start_top = true : (or false) set the starting position of the sprite view field to start from the top (or not).\n";
108 _msg +=
"initial_frame = 0 : set the frame that will be used as the first one, here the number represents the index of the frame.\n";
109 _msg +=
"end_frame = -1 : (or the index of the frame) set the last frame to be taken from the spritesheet(-1 means all frames present), (default value: -1).\n";
110 _msg +=
"fame_delay = 100 : (from 0 to 2147483647) delay between each frame in milliseconds (default value: 100)\n";
111 _buffer = _msg.c_str();
123 _msg =
"Error: The configuration you provided for the icon '" + spriteName +
"' in path '" + tomlPath +
"'is incorrect.\n";
124 _msg +=
"Below is a crude explanation of the structure, for more detailed information, please refer to the online documentation at: https://rtype.pingpal.news\n";
125 _msg +=
"You provided:\n" + userConfiguration +
"\n";
126 if (!exceptionDetail.empty()) {
127 _msg +=
"Additional details about the error: (" + exceptionDetail +
")\n";
129 _msg +=
"When the following structure was expected:\n";
130 _msg +=
"[icon] (this is the loaded version, in the file it should be [icon]) : the section containing the logo (unique identifier)\n";
131 _msg +=
"name = \"Logo Name\" : the name of the logo\n";
132 _msg +=
"path = \"<path to the logo>\" : set the path to the logo image\n";
133 _msg +=
"width = <width> : (0 to 1000) set the initial width of the logo (Default: 256)\n";
134 _msg +=
"height = <height> : (0 to 1000) set the initial height of the logo (Default: 256)\n";
135 _msg +=
"x = <x> : (0 to 2147483647) set the initial x position of the logo (Default: 0)\n";
136 _msg +=
"y = <y> : (0 to 2147483647) set the initial y position of the logo (Default: 0)\n";
137 _buffer = _msg.c_str();
149 _msg =
"Error: The configuration you provided for the background '" + spriteName +
"' in path '" + tomlPath +
"' is incorrect.\n";
150 _msg +=
"Below is a crude explanation of the structure, for more detailed information, please refer to the online documentation at: https://rtype.pingpal.news\n";
151 _msg +=
"You provided:\n" + userConfiguration +
"\n";
152 if (!exceptionDetail.empty()) {
153 _msg +=
"Additional details about the error: (" + exceptionDetail +
")\n";
155 _msg +=
"When the following structure was expected:\n";
156 _msg +=
"[<background_name>] (this is the loaded version, in the file it should be [backgrounds.<background_name>]) : the name of the background (unique identifier)\n";
157 _msg +=
"name = \"<name of the background>\" : set the name of the background(a human readable name)\n";
158 _msg +=
"path = \"<path to the background>\" : set the path to the background image\n";
159 _msg +=
"x = <x> : (0 to 2147483647) set the x position of the background (Default: 0)\n";
160 _msg +=
"y = <y> : (0 to 2147483647) set the y position of the background (Default: 0)\n";
161 _msg +=
"allow_as_level_background = true : (or false) allow the background to be used as a level background (Default: true)\n";
162 _buffer = _msg.c_str();
174 _msg =
"Error: The width you provided for the window is incorrect.\n";
175 _msg +=
"You provided: " + argument +
"\n";
176 _msg +=
"When the following structure was expected:\n";
177 _msg +=
"A positive integer, for example: 800\n";
178 _buffer = _msg.c_str();
190 _msg =
"Error: The X position you provided for the window is incorrect.\n";
191 _msg +=
"You provided: " + argument +
"\n";
192 _msg +=
"When the following structure was expected:\n";
193 _msg +=
"An integer, for example: 10\n";
194 _buffer = _msg.c_str();
206 _msg =
"Error: The Y position you provided for the window is incorrect.\n";
207 _msg +=
"You provided: " + argument +
"\n";
208 _msg +=
"When the following structure was expected:\n";
209 _msg +=
"An integer, for example: 10\n";
210 _buffer = _msg.c_str();
222 _msg =
"Error: The height you provided for the window is incorrect.\n";
223 _msg +=
"You provided: " + argument +
"\n";
224 _msg +=
"When the following structure was expected:\n";
225 _msg +=
"A positive integer, for example: 600\n";
226 _buffer = _msg.c_str();
238 _msg =
"Error: The frame limit you provided for the refresh rate is incorrect.\n";
239 _msg +=
"It must be between 10 and 1000.\n";
240 _msg +=
"Your framelimit was " + std::to_string(frameLimit);
241 _buffer = _msg.c_str();
246 _msg =
"Error: The frame limit you provided for the refresh rate is incorrect.\n";
247 _msg +=
"It must be between 10 and 1000.\n";
248 _msg +=
"Your framelimit was " + frameLimit;
249 _buffer = _msg.c_str();
261 _msg =
"Error: The width you provided is invalid.\n";
262 _msg +=
"The width was: '";
265 if (min.empty() ==
false) {
266 _msg +=
"The width was expected to be between ";
268 if (max.empty() ==
false) {
274 _buffer = _msg.c_str();
286 _msg =
"Error: The height you provided is invalid.\n";
287 _msg +=
"The height was: '";
290 if (min.empty() ==
false) {
291 _msg +=
"The height was expected to be between ";
293 if (max.empty() ==
false) {
299 _buffer = _msg.c_str();
312 _msg =
"Error: The path you provided for the font file is invalid.\n";
313 _msg +=
"The path was: '";
316 _buffer = _msg.c_str();
329 _msg =
"Error: The shape you have provided is invalid or ";
330 _msg +=
"has not been defined.";
331 if (extraDetails.empty() ==
false) {
332 _msg +=
"\n(" + extraDetails +
")";
334 _buffer = _msg.c_str();
346 _msg =
"Error: The content present in std::any does not match ";
347 _msg +=
"the provided type(or is just missing).";
348 if (extraDetails.empty() ==
false) {
349 _msg +=
"\n(" + extraDetails +
")";
351 _buffer = _msg.c_str();
363 _msg =
"Error: The index you provided is invalid.\n";
364 if (!min.empty() && !max.empty()) {
365 _msg +=
"The index must in the range of '" + min +
"' to '" + max +
"'.\n";
366 }
else if (!min.empty() && max.empty()) {
367 _msg +=
"The index must be greater than or equal to '" + min +
"'.\n";
368 }
else if (min.empty() && !max.empty()) {
369 _msg +=
"The index must be less than or equal to '" + max +
"'.\n";
371 _msg +=
"The index must be a valid number.\n";
373 _msg +=
"The index was: '";
376 _buffer = _msg.c_str();
388 _msg =
"Error: The duration you provided is invalid.\n";
389 if (!min.empty() && !max.empty()) {
390 _msg +=
"The duration must in the range '" + min +
"' to '" + max +
"'.\n";
391 }
else if (!min.empty() && max.empty()) {
392 _msg +=
"The duration must be greater than or equal to '" + min +
"'.\n";
393 }
else if (min.empty() && !max.empty()) {
394 _msg +=
"The duration must be less than or equal to '" + max +
"'.\n";
396 _msg +=
"The duration must be a valid number.\n";
398 _msg +=
"The duration was: '";
401 _buffer = _msg.c_str();
413 _msg =
"Error: The TOML file you provided is invalid\n";
414 _msg +=
"The filepath you provided is '" + path +
"'.\n";
415 _msg +=
"The detailed error is '" + error +
"'.";
416 _buffer = _msg.c_str();
428 _msg =
"Error: The type '" + type +
"' of the key '" + key +
"' for the spritesheet in the configuration file '" + path +
"' is incorrect.\n";
429 _msg +=
"The expected type is '" + expectedType +
"'.";
430 _buffer = _msg.c_str();
442 _msg =
"Error: The type '" + type +
"' of the key '" + key +
"' for the music in the configuration file '" + path +
"' is incorrect.\n";
443 _msg +=
"The expected type is '" + expectedType +
"'.";
444 _buffer = _msg.c_str();
456 _msg =
"Error: The type '" + type +
"' of the key '" + key +
"' for the font in the configuration file '" + path +
"' is incorrect.\n";
457 _msg +=
"The expected type is '" + expectedType +
"'.";
458 _buffer = _msg.c_str();
470 _msg =
"Error: The type of the key '";
475 _msg += expectedType;
476 _msg +=
"' type was expected for the configuration file '";
479 _buffer = _msg.c_str();
File in charge of informing the user that they have tried to access an invalid component.
~InvalidBackgroundConfiguration()
Destroy the Invalid Sprite Configuration object.
const char * what() const noexcept
Retrieves the error message.
InvalidBackgroundConfiguration(const std::string &tomlPath="", const std::string &userConfiguration="", const std::string &backgroundName="", const std::string &exceptionDetail="")
Construct a new Invalid Sprite Configuration object.
InvalidConfigurationFontType(const std::string &path="", const std::string &key="", const std::string &type="", const std::string &expectedType="")
Construct a new Invalid Configuration Font Type object.
const char * what() const noexcept
Retrieves the error message.
~InvalidConfigurationFontType()
Destroy the Invalid Configuration Font Type object.
~InvalidConfigurationMusicType()
Destroy the Invalid Configuration Music Type object.
InvalidConfigurationMusicType(const std::string &path="", const std::string &key="", const std::string &type="", const std::string &expectedType="")
Construct a new Invalid Configuration Music Type object.
const char * what() const noexcept
Retrieves the error message.
~InvalidConfigurationSpritesheetType()
Destroy the Invalid Configuration Spritesheet Type object.
InvalidConfigurationSpritesheetType(const std::string &path="", const std::string &key="", const std::string &type="", const std::string &expectedType="")
Construct a new Invalid Configuration Spritesheet Type object.
const char * what() const noexcept
Retrieves the error message.
const char * what() const noexcept
Retrieves the error message.
~InvalidDuration()
Destroy the Invalid Duration object.
InvalidDuration(const std::string &duration="", const std::string &min="", const std::string &max="")
Construct a new Invalid Duration object.
const char * what() const noexcept
Retrieves the error message.
InvalidFontConfiguration(const std::string &userConfiguration="", const std::string &fontName="")
Construct a new Invalid Font Configuration object.
~InvalidFontConfiguration()
Destroy the Invalid Font Configuration object.
~InvalidFontPath()
Destroy the Invalid Font Path object.
InvalidFontPath(const std::string &path="")
Construct a new Invalid Font Path object.
const char * what() const noexcept
Retrieves the error message.
const char * what() const noexcept
Retrieves the error message.
~InvalidFrameLimit()
Destroy the Invalid Frame Limit object.
InvalidFrameLimit(unsigned int frameLimit)
Construct a new Invalid Frame Limit object.
const char * what() const noexcept
Retrieves the error message.
~InvalidHeight()
Destroy the Invalid Height object.
InvalidHeight(const std::string &height="", const std::string &min="", const std::string &max="")
Construct a new Invalid Height object.
~InvalidIconConfiguration()
Destroy the Invalid Sprite Configuration object.
const char * what() const noexcept
Retrieves the error message.
InvalidIconConfiguration(const std::string &tomlPath="", const std::string &userConfiguration="", const std::string &iconName="", const std::string &exceptionDetail="")
Construct a new Invalid Sprite Configuration object.
InvalidIndex(const std::string &index="", const std::string &min="", const std::string &max="")
Construct a new Invalid Index object.
const char * what() const noexcept
Retrieves the error message.
~InvalidIndex()
Destroy the Invalid Index object.
~InvalidIp()
Destroy the Invalid Ip object.
const char * what() const noexcept
Retrieves the error message.
InvalidIp(const std::string &error="")
Construct a new Invalid Ip object.
InvalidMusicConfiguration(const std::string &userConfiguration="", const std::string &musicName="")
Construct a new Invalid Music Configuration object.
~InvalidMusicConfiguration()
Destroy the Invalid Music Configuration object.
const char * what() const noexcept
Retrieves the error message.
~InvalidPort()
Destroy the Invalid Port object.
InvalidPort(const std::string &error="")
Construct a new Invalid Port object.
const char * what() const noexcept
Retrieves the error message.
~InvalidShape()
Destroy the Invalid Shape object.
InvalidShape(const std::string &extraDetails="")
Construct a new Invalid Shape object.
const char * what() const noexcept
Retrieves the error message.
~InvalidSpriteConfiguration()
Destroy the Invalid Sprite Configuration object.
const char * what() const noexcept
Retrieves the error message.
InvalidSpriteConfiguration(const std::string &userConfiguration="", const std::string &spriteName="", const std::string &exceptionDetail="")
Construct a new Invalid Sprite Configuration object.
InvalidTOMLKeyType(const std::string &tomlPath="", const std::string &tomlKey="", const std::string ¤tType="", const std::string &expectedType="")
Construct a new Invalid toml Key Type object.
~InvalidTOMLKeyType()
Destroy the Invalid toml Key Type object.
const char * what() const noexcept
Retrieves the error message.
InvalidTOML(const std::string &path="", const std::string &error="")
Construct a new Invalid toml object.
const char * what() const noexcept
Retrieves the error message.
~InvalidTOML()
Destroy the Invalid toml object.
InvalidType(const std::string &extraDetails="")
Construct a new Invalid Type object.
const char * what() const noexcept
Retrieves the error message.
~InvalidType()
Destroy the Invalid Type object.
InvalidWidth(const std::string &width="", const std::string &min="", const std::string &max="")
Construct a new Invalid Width object.
~InvalidWidth()
Destroy the Invalid Width object.
const char * what() const noexcept
Retrieves the error message.
const char * what() const noexcept
Retrieves the error message.
InvalidWindowHeight(const std::string &argument="")
Construct a new Invalid Window Height object.
~InvalidWindowHeight()
Destroy the Invalid Window Height object.
const char * what() const noexcept
Retrieves the error message.
InvalidWindowWidth(const std::string &argument="")
Construct a new Invalid Window Width object.
~InvalidWindowWidth()
Destroy the Invalid Window Width object.
const char * what() const noexcept
Retrieves the error message.
InvalidWindowX(const std::string &argument="")
Construct a new Invalid Window X position object.
~InvalidWindowX()
Destroy the Invalid Window X position object.
const char * what() const noexcept
Retrieves the error message.
~InvalidWindowY()
Destroy the Invalid Window Width object.
InvalidWindowY(const std::string &argument="")
Construct a new Invalid Window Width object.