This is the header file for building your Necrowar AI  
 More...
#include <ai.hpp>
 | 
| virtual std::string  | get_name () const override | 
|   | This returns your AI's name to the game server. Replace the string name.  More...
  | 
|   | 
| virtual void  | start () override | 
|   | This is automatically called when the game first starts, once the game objects are created  More...
  | 
|   | 
| virtual void  | ended (bool won, const std::string &reason) override | 
|   | This is automatically called when the game ends.  More...
  | 
|   | 
| virtual void  | game_updated () override | 
|   | This is automatically called the game (or anything in it) updates  More...
  | 
|   | 
| bool  | run_turn () | 
|   | This is called every time it is this AI.player's turn.  More...
  | 
|   | 
| std::vector< Tile >  | find_path (const Tile &start, const Tile &goal) | 
|   | 
| const std::string &  | get_setting (const char *key) const noexcept | 
|   | Gets an AI setting passed to the program via the '–aiSettings' flag. Returns the empty string if the key was not set  More...
  | 
|   | 
| 
const std::string &  | get_setting (const std::string &key) const noexcept | 
|   | 
 | 
| Game  | game | 
|   | This is a reference to the Game object itself, it contains all the information about the current game  More...
  | 
|   | 
| Player  | player | 
|   | This is a pointer to your AI's player. This AI class is not a player, but it should command this Player.  More...
  | 
|   | 
This is the header file for building your Necrowar AI 
 
  
  
      
        
          | void cpp_client::necrowar::AI::ended  | 
          ( | 
          bool  | 
          won,  | 
         
        
           | 
           | 
          const std::string &  | 
          reason  | 
         
        
           | 
          ) | 
           |  | 
         
       
   | 
  
overridevirtual   | 
  
 
This is automatically called when the game ends. 
- Parameters
 - 
  
    | won | true if you won, false otherwise | 
    | reason | An explanation for why you either won or lost | 
  
   
 
 
      
        
          | std::vector< Tile > cpp_client::necrowar::AI::find_path  | 
          ( | 
          const Tile &  | 
          start,  | 
        
        
           | 
           | 
          const Tile &  | 
          goal  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
A very basic path finding algorithm (Breadth First Search) that when given a starting Tile, will return a valid path to the goal Tile. 
- Parameters
 - 
  
    | start | the starting Tile | 
    | goal | the goal Tile | 
  
   
<return>A List of Tiles representing the path, the the first element being a valid adjacent Tile to the start, and the last element being the goal. Or an empty list if no path found.</return> 
 
 
  
  
      
        
          | void cpp_client::necrowar::AI::game_updated  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
overridevirtual   | 
  
 
This is automatically called the game (or anything in it) updates 
 
 
  
  
      
        
          | std::string cpp_client::necrowar::AI::get_name  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
overridevirtual   | 
  
 
This returns your AI's name to the game server. Replace the string name. 
- Returns
 - The name of your AI.
 
 
 
  
  
      
        
          | const std::string & cpp_client::Base_ai::get_setting  | 
          ( | 
          const char *  | 
          key | ) | 
           const | 
         
       
   | 
  
noexceptinherited   | 
  
 
Gets an AI setting passed to the program via the '–aiSettings' flag. Returns the empty string if the key was not set 
- Parameters
 - 
  
    | key | The key of the setting to retrieve the value for. | 
  
   
- Returns
 - The string value set, or the empty string if none.
 
 
 
      
        
          | bool cpp_client::necrowar::AI::run_turn  | 
          ( | 
           | ) | 
           | 
        
      
 
This is called every time it is this AI.player's turn. 
- Returns
 - Represents if you want to end your turn. True means end your turn, False means to keep your turn going and re-call this function.
 
 
 
  
  
      
        
          | void cpp_client::necrowar::AI::start  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
overridevirtual   | 
  
 
This is automatically called when the game first starts, once the game objects are created 
 
 
      
        
          | Game cpp_client::necrowar::AI::game | 
        
      
 
This is a reference to the Game object itself, it contains all the information about the current game 
 
 
      
        
          | Player cpp_client::necrowar::AI::player | 
        
      
 
This is a pointer to your AI's player. This AI class is not a player, but it should command this Player. 
 
 
The documentation for this class was generated from the following files:
- games/necrowar/ai.hpp
 
- games/necrowar/ai.cpp