C++ Joueur Client
 All Classes Namespaces Functions Variables
ai.hpp
1 #ifndef GAMES_ANARCHY_AI_HPP
2 #define GAMES_ANARCHY_AI_HPP
3 
4 #include "impl/anarchy.hpp"
5 #include "game.hpp"
6 #include "building.hpp"
7 #include "fire_department.hpp"
8 #include "forecast.hpp"
9 #include "game_object.hpp"
10 #include "player.hpp"
11 #include "police_department.hpp"
12 #include "warehouse.hpp"
13 #include "weather_station.hpp"
14 
15 #include "../../joueur/src/base_ai.hpp"
16 #include "../../joueur/src/attr_wrapper.hpp"
17 
18 // <<-- Creer-Merge: includes -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.
19 // You can add additional #includes here
20 // <<-- /Creer-Merge: includes -->>
21 
22 namespace cpp_client
23 {
24 
25 namespace anarchy
26 {
27 
31 class AI : public Base_ai
32 {
33 public:
38 
43 
44  //<<-- Creer-Merge: class variables -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.
45  // You can add additional class variables here.
46  //<<-- /Creer-Merge: class variables -->>
47 
53  virtual std::string get_name() const override;
54 
58  virtual void start() override;
59 
65  virtual void ended(bool won, const std::string& reason) override;
66 
70  virtual void game_updated() override;
71 
76  bool run_turn();
77 
78  // <<-- Creer-Merge: methods -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.
79  // You can add additional methods here.
80  // <<-- /Creer-Merge: methods -->>
81 
82 
83 
84  // ####################
85  // Don't edit these!
86  // ####################
88  virtual std::string invoke_by_name(const std::string& name,
89  const std::unordered_map<std::string, Any>& args) override;
90  virtual void set_game(Base_game* ptr) override;
91  virtual void set_player(std::shared_ptr<Base_object> obj) override;
92  virtual void print_win_loss_info() override;
94  // ####################
95  // Don't edit these!
96  // ####################
97 
98 };
99 
100 } // ANARCHY
101 
102 } // cpp_client
103 
104 #endif // GAMES_ANARCHY_AI_HPP
This is the header file for building your Anarchy AI
Definition: ai.hpp:31
virtual void start() override
This is automatically called when the game first starts, once the game objects are created ...
Definition: ai.cpp:32
A player in this game. Every AI controls one player.
Definition: player.hpp:37
bool run_turn()
This is called every time it is this AI.player's turn.
Definition: ai.cpp:65
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:42
Definition: base_ai.hpp:16
Game game
This is a reference to the Game object itself, it contains all the information about the current game...
Definition: ai.hpp:37
virtual void game_updated() override
This is automatically called the game (or anything in it) updates
Definition: ai.cpp:42
Two player grid based game where each player tries to burn down the other player's buildings...
Definition: game.hpp:45
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