#include <filter.hpp>
Classes | |
struct | terrain_filter_cache |
Public Member Functions | |
terrain_filter (const vconfig &cfg, const filter_context *fc, const bool flat_tod=false, const size_t max_loop=game_config::max_loop) | |
terrain_filter (const vconfig &cfg, const terrain_filter &original) | |
~terrain_filter () | |
Default implementation, but defined out-of-line for efficiency reasons. More... | |
terrain_filter (const terrain_filter &other) | |
terrain_filter & | operator= (const terrain_filter &other) |
bool | match (const map_location &loc) const |
virtual bool | operator() (const map_location &loc) const |
void | get_locations (std::set< map_location > &locs, bool with_border=false) const |
void | restrict_size (const size_t max_loop) |
void | flatten (const bool flat_tod=true) |
config | to_config () const |
Private Member Functions | |
bool | match_internal (const map_location &loc, const bool ignore_xy) const |
Private Attributes | |
const vconfig | cfg_ |
const filter_context * | fc_ |
terrain_filter_cache | cache_ |
size_t | max_loop_ |
bool | flat_ |
Friends | |
class | terrain_filterimpl |
Additional Inherited Members | |
Protected Member Functions inherited from xy_pred | |
virtual | ~xy_pred () |
Definition at line 33 of file filter.hpp.
terrain_filter::terrain_filter | ( | const vconfig & | cfg, |
const filter_context * | fc, | ||
const bool | flat_tod = false , |
||
const size_t | max_loop = game_config::max_loop |
||
) |
Definition at line 65 of file filter.cpp.
Referenced by get_locations(), match(), match_internal(), and operator=().
terrain_filter::terrain_filter | ( | const vconfig & | cfg, |
const terrain_filter & | original | ||
) |
Definition at line 75 of file filter.cpp.
terrain_filter::~terrain_filter | ( | ) |
Default implementation, but defined out-of-line for efficiency reasons.
Definition at line 43 of file filter.cpp.
Referenced by operator=().
terrain_filter::terrain_filter | ( | const terrain_filter & | other | ) |
Definition at line 84 of file filter.cpp.
|
inline |
void terrain_filter::get_locations | ( | std::set< map_location > & | locs, |
bool | with_border = false |
||
) | const |
Definition at line 495 of file filter.cpp.
References terrain_filter::terrain_filter_cache::adjacent_matches, gamemap::border_size(), cache_, cfg_, vconfig::child(), cond(), ERR_NG, fc_, terrain_filterimpl::filter_area(), terrain_filterimpl::filter_special_loc(), terrain_filterimpl::filter_xy(), tod_manager::get_area_by_id(), vconfig::all_children_iterator::get_child(), vconfig::get_children(), filter_context::get_disp_context(), filter_context::get_game_data(), vconfig::all_children_iterator::get_key(), get_tiles_radius(), filter_context::get_tod_man(), gamemap::h(), h, vconfig::has_attribute(), vconfig::has_child(), i, display_context::map(), match_internal(), max_loop_, vconfig::ordered_begin(), vconfig::ordered_end(), gamemap::parse_location_range(), gamemap::special_location(), terrain_filter(), map_location::valid(), and gamemap::w().
Referenced by ai::cfun_ai_get_avoid(), pathfind::teleport_group::get_teleport_pair(), ai::formula_ai::get_value(), game_lua_kernel::intf_add_time_area(), game_lua_kernel::intf_find_cost_map(), game_lua_kernel::intf_get_locations(), game_lua_kernel::intf_shroud_op(), ai::readonly_context_impl::nearest_keep(), and unit_display::wml_animation_internal().
bool terrain_filter::match | ( | const map_location & | loc | ) | const |
Definition at line 364 of file filter.cpp.
References cfg_, vconfig::child(), cond(), ERR_NG, fc_, vconfig::all_children_iterator::get_child(), filter_context::get_disp_context(), vconfig::all_children_iterator::get_key(), get_tiles_radius(), vconfig::has_child(), i, display_context::map(), match_internal(), max_loop_, gamemap::on_board(), vconfig::ordered_begin(), vconfig::ordered_end(), and terrain_filter().
Referenced by unit::ability_active(), ai::readonly_context_impl::calculate_moves(), game_lua_kernel::intf_get_villages(), game_lua_kernel::intf_match_location(), operator()(), ai::ai_default_rca::remove_wrong_targets::operator()(), and attack_type::special_active().
|
private |
Definition at line 120 of file filter.cpp.
References terrain_filter::terrain_filter_cache::adjacent_match_cache, terrain_filter::terrain_filter_cache::adjacent_matches, variable_info< vit >::as_array(), variant::as_bool(), cache_, cfg_, vconfig::child(), map_location::default_dirs(), e, config::attribute_value::empty(), game_logic::formula::evaluate(), fc_, game_logic::formula_error::filename, gui2::event::find(), unit_map::find(), flat_, team::fogged(), get_adjacent_tiles(), tod_manager::get_area_by_id(), vconfig::get_children(), filter_context::get_disp_context(), filter_context::get_game_data(), tod_manager::get_illuminated_time_of_day(), filter_context::get_lua_kernel(), side_filter::get_teams(), gamemap::get_terrain(), gamemap::get_terrain_info(), tod_manager::get_time_of_day(), filter_context::get_tod_man(), vconfig::has_attribute(), vconfig::has_child(), i, time_of_day::id, in_ranges(), t_translation::t_match::is_empty, gamemap::is_village(), time_of_day::lawful_bonus, game_logic::formula_error::line, display_context::map(), map_location::matches_range(), vconfig::null(), terrain_type::number(), gamemap::on_board(), map_location::parse_directions(), utils::parse_ranges(), terrain_filter::terrain_filter_cache::parsed_terrain, game_lua_kernel::run_filter(), team::shrouded(), gamemap::special_location(), utils::split(), gamemap::tdata(), display_context::teams(), terrain_filter(), t_translation::terrain_matches(), config::attribute_value::to_int(), game_logic::formula_error::type, terrain_filter::terrain_filter_cache::ufilter_, display_context::units(), unit_map::iterator_base< iter_types >::valid(), display_context::village_owner(), lg::wml_error(), and WRN_NG.
Referenced by get_locations(), and match().
|
inlinevirtual |
terrain_filter & terrain_filter::operator= | ( | const terrain_filter & | other | ) |
Definition at line 95 of file filter.cpp.
References terrain_filter(), and ~terrain_filter().
|
inline |
Definition at line 63 of file filter.hpp.
References game_config::max_loop, and max_loop_.
config terrain_filter::to_config | ( | ) | const |
Definition at line 642 of file filter.cpp.
References cfg_, and vconfig::get_config().
Referenced by ai::readonly_context_impl::calculate_moves(), and ai::config_value_translator< terrain_filter >::value_to_cfg().
|
friend |
Definition at line 69 of file filter.hpp.
|
mutableprivate |
Definition at line 93 of file filter.hpp.
Referenced by get_locations(), and match_internal().
|
private |
Definition at line 73 of file filter.hpp.
Referenced by terrain_filterimpl::filter_area(), terrain_filterimpl::filter_special_loc(), terrain_filterimpl::filter_xy(), get_locations(), match(), match_internal(), and to_config().
|
private |
Definition at line 74 of file filter.hpp.
Referenced by terrain_filterimpl::filter_area(), terrain_filterimpl::filter_special_loc(), terrain_filterimpl::filter_xy(), get_locations(), match(), and match_internal().
|
private |
Definition at line 95 of file filter.hpp.
Referenced by flatten(), and match_internal().
|
private |
Definition at line 94 of file filter.hpp.
Referenced by get_locations(), match(), and restrict_size().