The Battle for Wesnoth  1.19.5+dev
Namespaces | Macros | Variables
function_table.cpp File Reference
#include <queue>
#include <set>
#include <utility>
#include <vector>
#include "ai/formula/ai.hpp"
#include "ai/formula/callable_objects.hpp"
#include "ai/formula/function_table.hpp"
#include "ai/default/contexts.hpp"
#include "formula/function_gamestate.hpp"
#include "attack_prediction.hpp"
#include "filesystem.hpp"
#include "game_board.hpp"
#include "display.hpp"
#include "log.hpp"
#include "map/label.hpp"
#include "map/map.hpp"
#include "pathfind/teleport.hpp"
#include "replay.hpp"
#include "resources.hpp"
#include "color.hpp"
#include "terrain/filter.hpp"
#include "units/unit.hpp"
#include "units/types.hpp"
#include "pathfind/pathfind.hpp"
Include dependency graph for function_table.cpp:

Go to the source code of this file.

Namespaces

 wfl
 

Macros

#define LOG_AI   LOG_STREAM(info, log_formula_ai)
 
#define WRN_AI   LOG_STREAM(warn, log_formula_ai)
 
#define ERR_AI   LOG_STREAM(err, log_formula_ai)
 
#define DEFINE_FAI_FUNCTION(name, min_args, max_args)
 
#define DECLARE_FAI_FUNCTION(name)    add_function(#name, std::make_shared<ai_formula_function<name##_function>>(#name, ai))
 

Variables

static lg::log_domain log_formula_ai ("ai/engine/fai")
 

Macro Definition Documentation

◆ DECLARE_FAI_FUNCTION

#define DECLARE_FAI_FUNCTION (   name)     add_function(#name, std::make_shared<ai_formula_function<name##_function>>(#name, ai))

Definition at line 1099 of file function_table.cpp.

◆ DEFINE_FAI_FUNCTION

#define DEFINE_FAI_FUNCTION (   name,
  min_args,
  max_args 
)
Value:
class name##_function : public function_expression \
{ \
public: \
explicit name##_function(const args_list& args, const formula_ai& ai) \
: function_expression(#name, args, min_args, max_args), ai_(ai) \
{ \
} \
\
private: \
const formula_ai& ai_; \
variant execute(const formula_callable& variables, formula_debugger* fdb) const; \
}; \
\
variant name##_function::execute(const formula_callable& variables, formula_debugger* fdb) const
formula_ai & ai_
A small explanation about what's going on here: Each action has access to two game_info objects First...
Definition: actions.cpp:59

Definition at line 110 of file function_table.cpp.

◆ ERR_AI

#define ERR_AI   LOG_STREAM(err, log_formula_ai)

Definition at line 47 of file function_table.cpp.

◆ LOG_AI

#define LOG_AI   LOG_STREAM(info, log_formula_ai)

Definition at line 45 of file function_table.cpp.

◆ WRN_AI

#define WRN_AI   LOG_STREAM(warn, log_formula_ai)

Definition at line 46 of file function_table.cpp.

Variable Documentation

◆ ai_

formula_ai& ai_
protected

Definition at line 1087 of file function_table.cpp.

◆ h

int h

Definition at line 148 of file function_table.cpp.

◆ in

unsigned in

If equal to search_counter, the node is off the list.

If equal to search_counter + 1, the node is on the list. Otherwise it is outdated.

Definition at line 164 of file function_table.cpp.

Referenced by base64::decode(), crypt64::decode(), preprocessor_data::get_chunk(), campaignd::server::handle_request_campaign(), campaignd::server::handle_upload(), campaignd::server::load_blacklist(), campaignd::server::load_config(), gui2::dialogs::log_settings::log_settings(), and read().

◆ loc_

◆ log_formula_ai

lg::log_domain log_formula_ai("ai/engine/fai") ( "ai/engine/fai"  )
static

◆ movement_cost_

int movement_cost_

Definition at line 156 of file function_table.cpp.

◆ nodes

const std::vector<node>& nodes

◆ unit_

const unit* unit_
private

Definition at line 107 of file function_table.cpp.

◆ unit_type_

const unit_type* unit_type_
private

Definition at line 106 of file function_table.cpp.

◆ w

int w

Definition at line 148 of file function_table.cpp.

Referenced by display_chat_manager::add_chat_message(), gui2::group< T >::add_member(), gui::textbox::add_text_line(), gui2::dialogs::generator_settings::adjust_minimum_size_by_players(), display::announce(), rect::area(), array_to_surface(), t_string_base::base_str(), display::bounds_check_position(), gui2::implementation::builder_drawing::build(), gui2::event::implementation::build_event_chain(), wb::move::calculate_new_route(), font::pango_text::calculate_size(), rect::center(), gui2::dialogs::mp_join_game::close_faction_select_dialog_if_open(), rect::contains(), wb::manager::create_temp_move(), gui2::default_status_value_getter(), gui2::round_rectangle_shape::draw(), gui2::image_shape::draw(), gui2::text_shape::draw(), game_display::draw_hex(), game_display::draw_movement_info(), events::menu_handler::execute_gotos(), gui2::scrollbar_container::find_at(), find_child_by_index(), find_child_by_name(), find_widget_impl(), gui2::event::implementation::fire_event(), gui2::event::fire_event(), gui2::event::fire_event_double_click(), spirit_po::catalog< hashmap_type, pf_compiler >::from_istream(), spirit_po::catalog< hashmap_type, pf_compiler >::from_iterators(), spirit_po::catalog< hashmap_type, pf_compiler >::from_range(), t_string_base::from_serialized(), gui2::listbox::get_active_sorting_option(), gui2::grid::get_child(), ai::formula_ai::get_keeps(), terrain_filter::get_locs_impl(), sdl::window::get_logical_size(), t_translation::get_map_size(), unit_frame::get_overlaped_hex(), gui2::rich_label::get_parsed_text(), wfl::gamemap_callable::get_value(), image::pixel_callable::get_value(), gui2::gui_definition::gui_definition(), editor::editor_palette< Item >::hide(), editor::location_palette::hide(), gui2::minimap::impl_draw_background(), impl_terrainmap_iter(), impl_widget_collect(), lua_widget::impl_widget_dir(), lua_widget::impl_widget_get(), impl_widget_length(), lua_widget::impl_widget_set(), gui2::lobby_player_list_helper::init(), video::init_window(), gui2::dialogs::preferences_dialog::initialize_callbacks(), intf_add_dialog_item(), intf_add_item_of_type(), intf_clear_items(), intf_dialog_close(), intf_find_widget(), intf_remove_dialog_item(), intf_set_dialog_callback(), intf_set_dialog_canvas(), intf_set_dialog_focus(), intf_terrainmap_create(), gui2::event::distributor::keyboard_remove_from_chain(), ai_testing::log_victory(), luaW_pushwidget(), display::minimap_location_on(), editor::context_manager::new_map_dialog(), editor::context_manager::new_scenario_dialog(), rect::operator*(), rect::operator*=(), rect::operator/(), rect::operator/=(), rect::padded_by(), gui2::implementation::parse_list_data(), gui2::grid::place(), rect::point_at(), gui2::dialogs::mp_create_game::pre_show(), register_widget_attribute(), terrain_builder::reload_map(), game_display::render(), editor::context_manager::resize_map_dialog(), scale_surface(), scale_surface_legacy(), scale_surface_sharp(), display::scroll_to_tiles(), gui2::listbox::set_active_sorting_option(), gui2::group< T >::set_callback_on_value_change(), gui2::grid::set_child(), gui2::window::set_exit_hook(), sdl::window::set_logical_size(), gui::widget::set_measurements(), gui2::group< T >::set_members_enabled(), sdl::window::set_size(), display::set_viewing_team_index(), spirit_po::catalog< hashmap_type, pf_compiler >::set_warning_channel(), font::floating_label::set_width(), gui::widget::set_width(), ai::formula_ai::shortest_path_calculator(), gui2::dialogs::team_mode_controller::show_ai_components(), gui2::dialogs::variable_mode_controller::show_array(), gui2::dialogs::unit_mode_controller::show_array(), gui2::dialogs::team_mode_controller::show_array(), gui2::dialogs::variable_mode_controller::show_var(), gui2::dialogs::unit_mode_controller::show_var(), gui2::dialogs::team_mode_controller::show_var(), gui2::event::distributor::signal_handler_notify_removal(), rect::size(), t_string_base::str(), surface::surface(), gui2::grid::swap_child(), play_controller::tab(), draw::tiled_highres(), t_string_base::to_serialized(), try_invalidate_layout(), halo::halo_impl::effect::update(), game_display::update(), video::update_framebuffer(), gui::scrollarea::update_location(), video::update_test_framebuffer(), gui::textbox::update_text_cache(), WIDGET_GETTER(), and WIDGET_SETTER().