C++ Joueur Client
 All Classes Namespaces Functions Variables
ai.hpp
1 #ifndef GAMES_SPIDERS_AI_HPP
2 #define GAMES_SPIDERS_AI_HPP
3 
4 #include "impl/spiders.hpp"
5 #include "game.hpp"
6 #include "brood_mother.hpp"
7 #include "cutter.hpp"
8 #include "game_object.hpp"
9 #include "nest.hpp"
10 #include "player.hpp"
11 #include "spider.hpp"
12 #include "spiderling.hpp"
13 #include "spitter.hpp"
14 #include "weaver.hpp"
15 #include "web.hpp"
16 
17 #include "../../joueur/src/base_ai.hpp"
18 #include "../../joueur/src/attr_wrapper.hpp"
19 
20 // <<-- Creer-Merge: includes -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.
21 // You can add additional #includes here
22 // <<-- /Creer-Merge: includes -->>
23 
24 namespace cpp_client
25 {
26 
27 namespace spiders
28 {
29 
33 class AI : public Base_ai
34 {
35 public:
40 
45 
46  //<<-- Creer-Merge: class variables -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.
47  // You can add additional class variables here.
48  //<<-- /Creer-Merge: class variables -->>
49 
55  virtual std::string get_name() const override;
56 
60  virtual void start() override;
61 
67  virtual void ended(bool won, const std::string& reason) override;
68 
72  virtual void game_updated() override;
73 
78  bool run_turn();
79 
80  // <<-- Creer-Merge: methods -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.
81  // You can add additional methods here.
82  // <<-- /Creer-Merge: methods -->>
83 
84 
85 
86  // ####################
87  // Don't edit these!
88  // ####################
90  virtual std::string invoke_by_name(const std::string& name,
91  const std::unordered_map<std::string, Any>& args) override;
92  virtual void set_game(Base_game* ptr) override;
93  virtual void set_player(std::shared_ptr<Base_object> obj) override;
94  virtual void print_win_loss_info() override;
96  // ####################
97  // Don't edit these!
98  // ####################
99 
100 };
101 
102 } // SPIDERS
103 
104 } // cpp_client
105 
106 #endif // GAMES_SPIDERS_AI_HPP
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
virtual void ended(bool won, const std::string &reason) override
This is automatically called when the game ends.
Definition: ai.cpp:54
There's an infestation of enemy spiders challenging your queen BroodMother spider! Protect her and at...
Definition: game.hpp:45
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
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
Game game
This is a reference to the Game object itself, it contains all the information about the current game...
Definition: ai.hpp:39
bool run_turn()
This is called every time it is this AI.player's turn.
Definition: ai.cpp:65
This is the header file for building your Spiders AI
Definition: ai.hpp:33
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:44