C++ Joueur Client
 All Classes Namespaces Functions Variables
ai.hpp
1 #ifndef GAMES_CHESS_AI_HPP
2 #define GAMES_CHESS_AI_HPP
3 
4 #include "impl/chess.hpp"
5 #include "game.hpp"
6 #include "game_object.hpp"
7 #include "player.hpp"
8 
9 #include "../../joueur/src/base_ai.hpp"
10 #include "../../joueur/src/attr_wrapper.hpp"
11 
12 // <<-- Creer-Merge: includes -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.
13 // You can add additional #includes here
14 // <<-- /Creer-Merge: includes -->>
15 
16 namespace cpp_client
17 {
18 
19 namespace chess
20 {
21 
25 class AI : public Base_ai
26 {
27 public:
32 
37 
38  //<<-- Creer-Merge: class variables -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.
39  // You can add additional class variables here.
40  //<<-- /Creer-Merge: class variables -->>
41 
47  virtual std::string get_name() const override;
48 
52  virtual void start() override;
53 
59  virtual void ended(bool won, const std::string& reason) override;
60 
64  virtual void game_updated() override;
65 
70  std::string make_move();
71 
72  // <<-- Creer-Merge: methods -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.
73  // You can add additional methods here.
74  // <<-- /Creer-Merge: methods -->>
75 
76 
77 
78  // ####################
79  // Don't edit these!
80  // ####################
82  virtual std::string invoke_by_name(const std::string& name,
83  const std::unordered_map<std::string, Any>& args) override;
84  virtual void set_game(Base_game* ptr) override;
85  virtual void set_player(std::shared_ptr<Base_object> obj) override;
86  virtual void print_win_loss_info() override;
88  // ####################
89  // Don't edit these!
90  // ####################
91 
92 };
93 
94 } // CHESS
95 
96 } // cpp_client
97 
98 #endif // GAMES_CHESS_AI_HPP
virtual void ended(bool won, const std::string &reason) override
This is automatically called when the game ends.
Definition: ai.cpp:54
The traditional 8x8 chess board with pieces.
Definition: game.hpp:45
virtual void game_updated() override
This is automatically called the game (or anything in it) updates
Definition: ai.cpp:42
std::string make_move()
This is called every time it is this AI.player's turn to make a move.
Definition: ai.cpp:65
virtual std::string get_name() const override
This returns your AI's name to the game server. Replace the string name.
Definition: ai.cpp:21
virtual void start() override
This is automatically called when the game first starts, once the game objects are created ...
Definition: ai.cpp:32
Definition: base_ai.hpp:16
Player player
This is a pointer to your AI's player. This AI class is not a player, but it should command this Play...
Definition: ai.hpp:36
This is the header file for building your Chess AI
Definition: ai.hpp:25
Game game
This is a reference to the Game object itself, it contains all the information about the current game...
Definition: ai.hpp:31
A player in this game. Every AI controls one player.
Definition: player.hpp:37