|
Zappy Server
C++ game server: world, rules, scheduler, network
|
#include <Args.hpp>
Collaboration diagram for Args:Public Member Functions | |
| Args (int argc, char **argv) | |
| bool | isValid () const |
| Checks if the parsed arguments are valid and if the application should run. | |
| bool | isHelpRequested () const |
| Checks if the help flag was provided in the arguments. | |
| int | exitCode () const |
| Gets the exit code for the application. | |
| ServerConfig | getConfig () const |
| Gets the configuration for the server application. | |
Private Types | |
| enum class | ParseResult { Success , HelpRequested , Error } |
Private Attributes | |
| ServerConfig | config = {-1, -1, -1, {}, 10, 100, 0} |
| ParseResult | result = ParseResult::Error |
Static Private Attributes | |
| static constexpr int | SUCCESS = 0 |
| static constexpr int | ERROR = 84 |
|
strongprivate |
| Args::Args | ( | int | argc, |
| char ** | argv | ||
| ) |
Definition at line 18 of file Args.cpp.
References ServerConfig::clientsNb, config, Error, ServerConfig::freq, ServerConfig::height, HelpRequested, ServerConfig::port, result, ServerConfig::seed, Success, ServerConfig::teamNames, and ServerConfig::width.
| int Args::exitCode | ( | ) | const |
| ServerConfig Args::getConfig | ( | ) | const |
| bool Args::isHelpRequested | ( | ) | const |
Checks if the help flag was provided in the arguments.
Definition at line 90 of file Args.cpp.
References HelpRequested, and result.
Referenced by main().
Here is the caller graph for this function:| bool Args::isValid | ( | ) | const |
Checks if the parsed arguments are valid and if the application should run.
Definition at line 89 of file Args.cpp.
References result, and Success.
Referenced by main().
Here is the caller graph for this function:
|
private |
Definition at line 77 of file Args.hpp.
Referenced by Args(), and getConfig().
|
staticconstexprprivate |
Definition at line 75 of file Args.hpp.
Referenced by exitCode().
|
private |
Definition at line 78 of file Args.hpp.
Referenced by Args(), exitCode(), isHelpRequested(), and isValid().
|
staticconstexprprivate |
Definition at line 74 of file Args.hpp.
Referenced by exitCode().