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