Endgame-Analyzer/include/command_line_interface.h

36 lines
1,018 B
C
Raw Normal View History

#ifndef DYNAMIC_PROGRAM_COMMAND_LINE_INTERFACE_H
#define DYNAMIC_PROGRAM_COMMAND_LINE_INTERFACE_H
#include <variant>
#include <boost/optional.hpp>
#include "game_state.h"
namespace Hanabi {
enum class GameStateSpecType {
turn = 0,
draw_pile_size = 1,
};
struct CLIParms {
std::variant<int, std::string> game {};
boost::optional<uint8_t> score_goal {};
GameStateSpecType game_state_spec_type { GameStateSpecType::draw_pile_size };
unsigned game_state_spec { 5 };
boost::optional<bool> interactive {};
bool quiet { false };
// If this holds std::monostate, then all clue numbers are evaluated
2023-11-14 13:13:49 +01:00
std::variant<std::monostate, clue_t> clue_spec {static_cast<clue_t>(0)};
bool recursive { false };
};
std::ostream & quiet_ostream(bool quiet);
constexpr int download_failed = 1;
constexpr int state_unreachable = 2;
std::optional<CLIParms> parse_parms(int argc, char *argv[]);
int run_cli(CLIParms parms);
}
#endif //DYNAMIC_PROGRAM_COMMAND_LINE_INTERFACE_H