|
Wrath of Zeus
Made by Torchlight Games for CSE 125 SP24
|
#include <config.hpp>
Static Public Member Functions | |
| static GameConfig | parse (int argc, char **argv) |
Data Fields | |
| struct { | |
| struct { | |
| std::string directory | |
| Path of the directory (contained in the repository directory) that contains maze map files. More... | |
| bool procedural | |
| whether or not to generate and use a procedurally generated maze More... | |
| std::string maze_file | |
| Name of the maze file within the maze maps directory that the server should load. More... | |
| } maze | |
| bool disable_enemies | |
| } | game |
| Game config options. More... | |
| struct { | |
| std::string server_ip | |
| IP that the server is being hosted on. E.g. "127.0.0.1" for localhost. More... | |
| int server_port | |
| Port that the server is running on. This should be a value between 2302-2400, or 6073 so that it can be accepted through the firewall on lab computers. More... | |
| } | network |
| Shared config settings for the network. More... | |
| struct { | |
| std::string lobby_name | |
| Name of the server's lobby. More... | |
| bool lobby_broadcast | |
| Whether or not the server should broadcast that the server is. More... | |
| int max_players | |
| max number of players this server allows More... | |
| bool disable_dm | |
| whether or not the server will spawn a DM More... | |
| bool skip_intro | |
| whether or not to skip the intro cutscene More... | |
| } | server |
| Config settings for the server. More... | |
| struct { | |
| std::string default_name | |
| Default name of the client. More... | |
| bool lobby_discovery | |
| Whether or not the client should listen for server lobby broadcasts. More... | |
| bool fullscreen | |
| bool draw_bboxes | |
| bool fps_counter | |
| bool presentation | |
| int render | |
| } | client |
| Config settings for the client. More... | |
Struct which is a 1:1 mapping with the expected file format of the config.json file, so that our code only has to reference this struct instead of having to know the exact string indices to use to index into the nlohmann::json object.
|
static |
Parses the config file and returns back a representation of the file with all options specified. If the first command line argument specifies a different config file, then it load that, but if no argument is specified then it tries to look relative to the executable. It expects the directory to look like
group3/
So it looks relative from the binary location and assumes that the config.json is at the root of the repository.
| argc | Number of command line arguments. |
| argv | Command line arguments |
| struct { ... } GameConfig::client |
Config settings for the client.
| std::string GameConfig::default_name |
Default name of the client.
| std::string GameConfig::directory |
Path of the directory (contained in the repository directory) that contains maze map files.
| bool GameConfig::disable_dm |
whether or not the server will spawn a DM
| bool GameConfig::disable_enemies |
| bool GameConfig::draw_bboxes |
| bool GameConfig::fps_counter |
| bool GameConfig::fullscreen |
| struct { ... } GameConfig::game |
Game config options.
| bool GameConfig::lobby_broadcast |
Whether or not the server should broadcast that the server is.
| bool GameConfig::lobby_discovery |
Whether or not the client should listen for server lobby broadcasts.
| std::string GameConfig::lobby_name |
Name of the server's lobby.
| int GameConfig::max_players |
max number of players this server allows
| struct { ... } GameConfig::maze |
| std::string GameConfig::maze_file |
Name of the maze file within the maze maps directory that the server should load.
| struct { ... } GameConfig::network |
Shared config settings for the network.
| bool GameConfig::presentation |
| bool GameConfig::procedural |
whether or not to generate and use a procedurally generated maze
| int GameConfig::render |
| struct { ... } GameConfig::server |
Config settings for the server.
| std::string GameConfig::server_ip |
IP that the server is being hosted on. E.g. "127.0.0.1" for localhost.
| int GameConfig::server_port |
Port that the server is running on. This should be a value between 2302-2400, or 6073 so that it can be accepted through the firewall on lab computers.
| bool GameConfig::skip_intro |
whether or not to skip the intro cutscene