This is the header file for building your Spiders 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...
|
|
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 Spiders AI
void cpp_client::spiders::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::spiders::AI::game_updated |
( |
| ) |
|
|
overridevirtual |
This is automatically called the game (or anything in it) updates
std::string cpp_client::spiders::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::spiders::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::spiders::AI::start |
( |
| ) |
|
|
overridevirtual |
This is automatically called when the game first starts, once the game objects are created
Game cpp_client::spiders::AI::game |
This is a reference to the Game object itself, it contains all the information about the current game
Player cpp_client::spiders::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/spiders/ai.hpp
- games/spiders/ai.cpp