This is the header file for building your Chess 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...
|
|
std::string | make_move () |
| This is called every time it is this AI.player's turn to make a move. More...
|
|
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 Chess AI
void cpp_client::chess::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 |
void cpp_client::chess::AI::game_updated |
( |
| ) |
|
|
overridevirtual |
This is automatically called the game (or anything in it) updates
std::string cpp_client::chess::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.
std::string cpp_client::chess::AI::make_move |
( |
| ) |
|
This is called every time it is this AI.player's turn to make a move.
- Returns
- A string in Universal Chess Interface (UCI) or Standard Algebraic Notation (SAN) formatting for the move you want to make. If the move is invalid or not properly formatted you will lose the game.
void cpp_client::chess::AI::start |
( |
| ) |
|
|
overridevirtual |
This is automatically called when the game first starts, once the game objects are created
Game cpp_client::chess::AI::game |
This is a reference to the Game object itself, it contains all the information about the current game
Player cpp_client::chess::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/chess/ai.hpp
- games/chess/ai.cpp