diff options
| author | Charlie Blake | 2018-04-05 15:54:20 +0100 |
|---|---|---|
| committer | GitHub | 2018-04-05 15:54:20 +0100 |
| commit | 4c4bf8a2e153b0ead77931285704aa7a0d2b7475 (patch) | |
| tree | 716b8cc644945daaa1d9665f7ffc98a25d4a36d4 /src/main/main.cpp | |
| parent | Merge pull request #48 from thecharlesblake/wider-testing (diff) | |
| parent | Add cmd line opts to list games and describe rules (diff) | |
| download | metasol-4c4bf8a2e153b0ead77931285704aa7a0d2b7475.tar.gz metasol-4c4bf8a2e153b0ead77931285704aa7a0d2b7475.zip | |
Merge pull request #49 from thecharlesblake/add-more-games
Add more games
Diffstat (limited to 'src/main/main.cpp')
| -rw-r--r-- | src/main/main.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/main.cpp b/src/main/main.cpp index a1d1037..16a5ba1 100644 --- a/src/main/main.cpp +++ b/src/main/main.cpp @@ -4,6 +4,7 @@ #include <gperftools/profiler.h> #include "input-output/input/command_line_helper.h" +#include "input-output/input/sol_preset_types.h" #include "input-output/input/json-parsing/json_helper.h" #include "input-output/input/json-parsing/rules_parser.h" #include "input-output/output/log_helper.h" @@ -30,6 +31,17 @@ int main(int argc, const char* argv[]) { return EXIT_FAILURE; } + // If the user has asked for the list of preset game types, prints it + if (clh.get_available_game_types()) { + sol_preset_types::print_available_games(); + return EXIT_SUCCESS; + } + string game_rule_str = clh.get_describe_game_rules(); + if (!game_rule_str.empty()) { + sol_preset_types::describe_game_rules(game_rule_str); + return EXIT_SUCCESS; + } + // Generates the rules of the solitaire from the game type const optional<sol_rules> rules = gen_rules(clh); if (!rules) return EXIT_FAILURE; |
