ai.cpp File Reference

Artificial intelligence - The computer commands the enemy. More...

#include "ai.hpp"
#include "ai2.hpp"
#include "ai_dfool.hpp"
#include "actions.hpp"
#include "callable_objects.hpp"
#include "dialogs.hpp"
#include "foreach.hpp"
#include "formula_ai.hpp"
#include "game_config.hpp"
#include "game_events.hpp"
#include "game_preferences.hpp"
#include "gettext.hpp"
#include "log.hpp"
#include "menu_events.hpp"
#include "replay.hpp"
#include "statistics.hpp"
#include "unit_display.hpp"
#include "unit.hpp"
#include "playturn.hpp"
#include "wml_exception.hpp"
#include <cassert>

Include dependency graph for ai.cpp:

Go to the source code of this file.

Classes

class  idle_ai
 A trivial ai that sits around doing absolutely nothing. More...
class  sample_ai
 Sample ai, with simple strategy. More...

Defines

#define LOG_AI   LOG_STREAM(info, ai)
#define WRN_AI   LOG_STREAM(warn, ai)
#define ERR_AI   LOG_STREAM(err, ai)

Functions

std::vector< std::string > get_available_ais ()
 Returns all currently available AIs.
ai_interfacecreate_ai (const std::string &name, ai_interface::info &info)
 Create a new AI object with the specified algorithm name.
template<typename Container>
variant villages_from_set (const Container &villages, const std::set< gamemap::location > *exclude=NULL)


Detailed Description

Artificial intelligence - The computer commands the enemy.

Definition in file ai.cpp.


Define Documentation

#define ERR_AI   LOG_STREAM(err, ai)

Definition at line 48 of file ai.cpp.

Referenced by ai::average_resistance_against(), and ai::move_leader_to_goals().

#define LOG_AI   LOG_STREAM(info, ai)

#define WRN_AI   LOG_STREAM(warn, ai)

Definition at line 47 of file ai.cpp.

Referenced by ai::move_leader_to_goals(), and ai::recruit_usage().


Function Documentation

ai_interface* create_ai ( const std::string &  name,
ai_interface::info info 
)

Create a new AI object with the specified algorithm name.

Definition at line 198 of file ai.cpp.

References ai, lg::err, and LOG_STREAM.

Referenced by formula_ai::execute_variant(), formula_ai::make_move(), and playsingle_controller::play_ai_turn().

std::vector<std::string> get_available_ais (  ) 

Returns all currently available AIs.

Definition at line 184 of file ai.cpp.

References python_ai::get_available_scripts().

Referenced by mp::connect::lists_init().

template<typename Container>
variant @4::villages_from_set ( const Container &  villages,
const std::set< gamemap::location > *  exclude = NULL 
) [inline, static]

Definition at line 2204 of file ai.cpp.

References loc.

Referenced by ai_interface::get_value().


Variable Documentation

Definition at line 807 of file ai.cpp.

Referenced by ai::access_points(), halo::add(), terrain_builder::build_terrains(), gui::button::calculate_size(), check_checksums(), ai::choose_move(), display::create_buttons(), default_generate_map(), ai::do_recruitment(), do_replay_handle(), map_editor::brush_bar::draw(), map_editor::terrain_palette::draw(), gui::textbox::draw_contents(), gui::slider::draw_contents(), mp::wait::leader_preview_pane::draw_contents(), help::help_text_area::draw_contents(), gui::button::draw_contents(), draw_label(), draw_panel(), gui::menu::draw_row(), image::exists(), map_editor::flood_fill(), generate_river_internal(), map_editor::get_component(), game_logic::get_functions_map(), mp::gamebrowser::get_item_rect(), gui::menu::get_item_rect_internal(), formula_ai::get_keeps(), get_player_info(), get_tile_ring(), map_editor::get_tiles(), get_tiles_radius(), ai::get_villages(), image::getMinimap(), gui::scrollbar::grip_area(), gui::scrollbar::groove_area(), gui::textbox::handle_event(), mp::gamebrowser::handle_event(), gui::menu::hit(), gui::menu::hit_heading(), if(), image_width(), game_display::invalidate_animations(), display::invalidate_locations_in_rect(), ai::keeps(), events::mouse_handler::left_click(), display::minimap_location_on(), events::mouse_handler::mouse_motion(), events::mouse_handler::mouse_press(), ai::move_leader_to_goals(), ai_interface::move_unit(), move_unit(), terrain_builder::parse_config(), wesnothd::ban_manager::parse_time(), cave_map_generator::place_items(), place_village(), gui::combo::process_event(), gui::menu::process_help_string(), game_display::process_reachmap_changes(), rank_castle_location(), map_labels::read(), map_editor::recalculate_starting_pos_labels(), scale_surface(), gui::slider::set_slider_position(), gui::slider::slider_area(), events::menu_handler::unit_list(), verify(), and villages_from_set().

Definition at line 1598 of file ai.cpp.

int radius

double value


Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs