Newer
Older
#ifndef __CONFIG_HPP__
#define __CONFIG_HPP__
#include <string>
#include "penguin_heuristic.hpp"
#include "penguin.hpp"
#define DEFAULT_FILENAME "AI.conf"
namespace game {
class config {
public:
const bool is_ai_vs_ai() {return ai_vs_ai;};
const bool should_send_game_to_gui(){return send_game_to_gui;};
const unsigned int get_think_time() { return think_time; };
const unsigned int get_game_count() { return game_count; };
const mcts::penguin_heuristic* get_heuristic(short player) {return player == 1 ? heuristic_ai_1 : heuristic_ai_2; };
~config() {delete heuristic_ai_1; delete heuristic_ai_2;}
static config& get_config()
{
static std::string s(DEFAULT_FILENAME);
static config c(s);
return c;
};
config(config const&) = delete;
void operator=(config const&) = delete;
config(std::string& filename);
void handle_line(const std::string& option_name, const std::string& option_value);
void set_game_mode(const std::string& value);
void set_think_time(const std::string& value);
void set_game_count(const std::string& value);
void set_heuristic(const std::string& value, short player);
void set_send_game(const std::string& value);
bool ai_vs_ai, send_game_to_gui;
unsigned int think_time;
unsigned int game_count;
mcts::penguin_heuristic* heuristic_ai_1;
mcts::penguin_heuristic* heuristic_ai_2;
};
}
#endif