R-Type  2
Doom but in better
Loading...
Searching...
No Matches
HelpFunctions.cpp
Go to the documentation of this file.
1/*
2** EPITECH PROJECT, 2024
3** rtype (Workspace)
4** File description:
5** HelpFunctions.cpp
6*/
7
14#include <iostream>
15#include "Constants.hpp"
16
22static void displayUsageSummary(const std::string binName)
23{
24 std::cout << "USAGE:\n";
25 std::cout << "\t" << binName << " [--ip] [--port] [--log] [--debug] [--help] [--version]";
26 // std::cout << " [--full-screen] [--window-width] [--window-height]";
27 std::cout << " [--frame-rate-limit] [--config-file] [--username]";
28 std::cout << " [--position-x] [--position-y] [--window-title]";// [--cursor] ";
29 // std::cout << " [--cursor-icon] [--image-is-sprite] [--sprite-start-top] ";
30 // std::cout << " [--sprite-start-left] [--sprite-width] [--sprite-height]";
31 std::cout << std::endl;
32}
33
38static void displayDetailedUsage()
39{
40 std::cout << "OPTIONS:\n";
41 std::cout << "\t--ip=\"127.0.0.1\" \tSet the value of the ip on which the program will communicate. (Default value: 127.0.0.1)\n";
42 std::cout << "\t--port=\"9000\" \tSet the value of the port on which the program will communicate. (Default value: 9000)\n";
43 std::cout << "\t--log \tEnable logging.\n";
44 std::cout << "\t--debug \tEnable debug logging. (if this option is provided, the --log flag becomes forced regardless of it being provided or not)\n";
45 std::cout << "\t--help \tDisplay this help message and exit.\n\n";
46 std::cout << "\t--version \tDisplay the version of the program and exit.\n";
47 // std::cout << "\t--full-screen \tEnable full screen mode.\n";
48 // std::cout << "\t--window-width=\"800\" \tSet the width of the window. (Default value: 800)\n";
49 // std::cout << "\t--window-height=\"600\" \tSet the height of the window. (Default value: 600)\n";
50 std::cout << "\t--frame-rate-limit=\"60\" \tSet the frame rate limit of the window. (Default value: 60)\n";
51 std::cout << "\t--config-file=\"client_config.toml\" \tSet the path to the toml file that contains the sprites to load. (Default value: client_config.toml)\n";
52 std::cout << "\t--username=\"Player\" \tSet the name of the player that is going to connect (Default value: \"Player\")\n";
53 std::cout << "\t--position-x=\"0\" \tSet the x position of the window. (Default value: 0)\n";
54 std::cout << "\t--position-y=\"0\" \tSet the y position of the window. (Default value: 0)\n";
55 std::cout << "\t--window-title=\"R-Type\" \tSet the title of the window. (Default value: \"R-Type\")\n";
56 // std::cout << "\t--cursor=\"true\" \tShow/Hide the cursor. (Default value: true)\n";
57 // std::cout << "\t--cursor-icon=\"cursor.png\" \tSet the path of the cursor icon. (Default value: \"null\")\n";
58 // std::cout << "\t--image-is-sprite=\"false\" \tSet if the provided image is a spritesheet. (Default value: \"false\")\n";
59 // std::cout << "\t--sprite-start-top=\"true\" \tAnimate by going from top to bottom (or bottom to top). (Default value: \"true\")\n";
60 // std::cout << "\t--sprite-start-left=\"true\" \tAnimate by going from left to right (or right to left). (Default value: \"true\")\n";
61 // std::cout << "\t--sprite-width=\"20\" \tSet the width of the sprite in the animation. (Default value: 20)\n";
62 // std::cout << "\t--sprite-height=\"20\" \tSet the height of the sprite in the animation. (Default value: 20)\n";
63 std::cout << std::endl;
64}
65
70static void displayAuthors()
71{
72 std::cout << "AUTHORS:\n";
73 std::cout << "This program was created for Epitech ";
74 std::cout << "project by students of the Epitech school.\n";
75 std::cout << "These sets of programs (r-type_client and r-type_server) ";
76 std::cout << "were written by:\n";
77 std::cout << "\t-\tMarianna Titova : https://github.com/marianna-titova\n";
78 std::cout << "\t-\tTristan Wehrle : https://github.com/floksdev)\n";
79 std::cout << "\t-\tArthur-agusto Claro-sardella : https://github.com/DoctorTangerina)\n";
80 std::cout << "\t-\tHenry Letellier : https://github.com/HenraL\n";
81 std::cout << std::endl;
82}
83
88void DisplayVersion(bool helpMode = false)
89{
90 if (helpMode) {
91 std::cout << "VERSION:\n";
92 }
93 std::cout << "The program's version is: " << VERSION << std::endl;
94}
95
101void DisplayHelp(const std::string binName)
102{
103 displayUsageSummary(binName);
104 std::cout << std::endl;
105 displayDetailedUsage();
106 std::cout << std::endl;
107 displayAuthors();
108 std::cout << std::endl;
109 DisplayVersion(true);
110}
This is the file in charge of containing the constants that are meant to be used throughout the progr...
void DisplayVersion(bool helpMode=false)
Displays version information for the program.
void DisplayHelp(const std::string binName)
The main function of the help display.