C++ Joueur Client
 All Classes Namespaces Functions Variables
base_ai.hpp
1 #ifndef BASE_AI_HPP
2 #define BASE_AI_HPP
3 
4 #include "any.hpp"
5 
6 #include <string>
7 #include <vector>
8 #include <unordered_map>
9 
10 namespace cpp_client
11 {
12 
13 class Base_game;
14 class Base_object;
15 
16 class Base_ai
17 {
18 public:
25  const std::string& get_setting(const char* key) const noexcept;
26  const std::string& get_setting(const std::string& key) const noexcept;
27 
29  virtual std::string get_name() const = 0;
30  virtual void start() = 0;
31  virtual void ended(bool won, const std::string& reason) = 0;
32  virtual void invalid(const std::string& message);
33  virtual void game_updated() = 0;
34  virtual std::string invoke_by_name(const std::string& name,
35  const std::unordered_map<std::string, Any>& args) = 0;
36  virtual ~Base_ai();
37  virtual void set_game(Base_game* ptr) = 0;
38  virtual void set_player(std::shared_ptr<Base_object> obj) = 0;
39  virtual void print_win_loss_info() = 0;
41 
42 private:
43  std::unordered_map<std::string, std::string> passed_params_;
44 
45  friend void Base_game::set_ai_parameters(const std::string& params);
46 };
47 
48 } // cpp_client
49 
50 #endif // BASE_AI_HPP
Definition: base_ai.hpp:16
const std::string & get_setting(const char *key) const noexcept
Gets an AI setting passed to the program via the '–aiSettings' flag. Returns the empty string if the ...
Definition: base_ai.cpp:16