C++ Joueur Client
 All Classes Namespaces Functions Variables
ai.hpp
1 #ifndef GAMES_PIRATES_AI_HPP
2 #define GAMES_PIRATES_AI_HPP
3 
4 #include "impl/pirates.hpp"
5 #include "game.hpp"
6 #include "game_object.hpp"
7 #include "player.hpp"
8 #include "port.hpp"
9 #include "tile.hpp"
10 #include "unit.hpp"
11 
12 #include "../../joueur/src/base_ai.hpp"
13 #include "../../joueur/src/attr_wrapper.hpp"
14 
15 // <<-- Creer-Merge: includes -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.
16 // You can add additional #includes here
17 // <<-- /Creer-Merge: includes -->>
18 
19 namespace cpp_client
20 {
21 
22 namespace pirates
23 {
24 
28 class AI : public Base_ai
29 {
30 public:
35 
40 
41  //<<-- Creer-Merge: class variables -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.
42  // You can add additional class variables here.
43  //<<-- /Creer-Merge: class variables -->>
44 
50  virtual std::string get_name() const override;
51 
55  virtual void start() override;
56 
62  virtual void ended(bool won, const std::string& reason) override;
63 
67  virtual void game_updated() override;
68 
73  bool run_turn();
74 
75  // <<-- Creer-Merge: methods -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.
76  // You can add additional methods here.
77  // <<-- /Creer-Merge: methods -->>
78 
83 std::vector<Tile> find_path(const Tile& start, const Tile& goal);
84 
85 
86 
87  // ####################
88  // Don't edit these!
89  // ####################
91  virtual std::string invoke_by_name(const std::string& name,
92  const std::unordered_map<std::string, Any>& args) override;
93  virtual void set_game(Base_game* ptr) override;
94  virtual void set_player(std::shared_ptr<Base_object> obj) override;
95  virtual void print_win_loss_info() override;
97  // ####################
98  // Don't edit these!
99  // ####################
100 
101 };
102 
103 } // PIRATES
104 
105 } // cpp_client
106 
107 #endif // GAMES_PIRATES_AI_HPP
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:39
virtual void start() override
This is automatically called when the game first starts, once the game objects are created ...
Definition: ai.cpp:32
A Tile in the game that makes up the 2D map grid.
Definition: tile.hpp:37
std::vector< Tile > find_path(const Tile &start, const Tile &goal)
Definition: ai.cpp:77
bool run_turn()
This is called every time it is this AI.player's turn.
Definition: ai.cpp:65
Definition: base_ai.hpp:16
Steal from merchants and become the most infamous pirate.
Definition: game.hpp:45
Game game
This is a reference to the Game object itself, it contains all the information about the current game...
Definition: ai.hpp:34
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 game_updated() override
This is automatically called the game (or anything in it) updates
Definition: ai.cpp:42
This is the header file for building your Pirates AI
Definition: ai.hpp:28
virtual void ended(bool won, const std::string &reason) override
This is automatically called when the game ends.
Definition: ai.cpp:54
A player in this game. Every AI controls one player.
Definition: player.hpp:37