#include <filter.hpp>
Classes | |
struct | terrain_filter_cache |
Public Member Functions | |
terrain_filter (const vconfig &cfg, const filter_context *fc, const bool flat_tod) | |
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 |
bool | match (const map_location &loc, const unit &ref_unit) const |
virtual bool | operator() (const map_location &loc) const |
void | get_locations (std::set< map_location > &locs, bool with_border=false) const |
gets all locations on the map that match this filter More... | |
void | get_locations (std::set< map_location > &locs, const unit &ref_unit, bool with_border=false) const |
gets all locations on the map that match this filter More... | |
void | flatten (const bool flat_tod=true) |
config | to_config () const |
Public Member Functions inherited from filter_impl | |
filter_impl () | |
virtual bool | matches (const gamemap_base &m, map_location l) const =0 |
virtual | ~filter_impl () |
Private Member Functions | |
bool | match_impl (const map_location &loc, const unit *ref_unit) const |
void | get_locs_impl (std::set< map_location > &locs, const unit *ref_unit, bool with_border) const |
bool | match_internal (const map_location &loc, const unit *ref_unit, const bool ignore_xy) const |
Private Attributes | |
const vconfig | cfg_ |
const filter_context * | fc_ |
terrain_filter_cache | cache_ |
const std::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 28 of file filter.hpp.
terrain_filter::terrain_filter | ( | const vconfig & | cfg, |
const filter_context * | fc, | ||
const bool | flat_tod | ||
) |
Definition at line 50 of file filter.cpp.
References terrain_filter().
Referenced by get_locs_impl(), match_impl(), match_internal(), and terrain_filter().
terrain_filter::terrain_filter | ( | const vconfig & | cfg, |
const terrain_filter & | original | ||
) |
Definition at line 59 of file filter.cpp.
References terrain_filter().
terrain_filter::~terrain_filter | ( | ) |
Default implementation, but defined out-of-line for efficiency reasons.
Definition at line 46 of file filter.cpp.
References ~terrain_filter().
Referenced by ~terrain_filter().
terrain_filter::terrain_filter | ( | const terrain_filter & | other | ) |
Definition at line 68 of file filter.cpp.
References terrain_filter().
|
inline |
Definition at line 78 of file filter.hpp.
References flat_.
|
inline |
gets all locations on the map that match this filter
[out] | locs | set to store the results in |
[in] | with_border | whether to include the borders |
Definition at line 63 of file filter.hpp.
References get_locs_impl().
Referenced by ai::formula_ai::get_value(), game_lua_kernel::intf_add_time_area(), game_lua_kernel::intf_find_cost_map(), and game_lua_kernel::intf_get_locations().
|
inline |
gets all locations on the map that match this filter
[out] | locs | set to store the results in |
[in] | with_border | whether to include the borders |
[in] | ref_unit | A reference unit for the $teleport_unit auto-stored variable |
Definition at line 73 of file filter.hpp.
References get_locs_impl().
|
private |
Definition at line 513 of file filter.cpp.
References terrain_filter::terrain_filter_cache::adjacent_matches, vconfig::all_ordered(), gamemap_base::border_size(), cache_, cfg_, vconfig::child(), ERR_NG, fc_, terrain_filterimpl::filter_area(), terrain_filterimpl::filter_special_loc(), terrain_filterimpl::filter_xy(), tod_manager::get_area_by_id(), vconfig::get_children(), filter_context::get_disp_context(), filter_context::get_game_data(), unit::get_location(), get_locs_impl(), get_tiles_radius(), filter_context::get_tod_man(), gamemap_base::h(), h, vconfig::has_attribute(), vconfig::has_child(), i, display_context::map(), match_internal(), max_loop_, gamemap_base::on_board(), vconfig::ordered_begin(), vconfig::ordered_end(), gamemap_base::parse_location_range(), gamemap_base::special_location(), utils::split(), terrain_filter(), display_context::units(), map_location::valid(), gamemap::villages(), w, and gamemap_base::w().
Referenced by get_locations(), and get_locs_impl().
|
inline |
loc | The location to test |
Definition at line 43 of file filter.hpp.
References match_impl().
Referenced by game_lua_kernel::intf_match_location(), operator()(), and attack_type::special_active_impl().
|
inline |
loc | The location to test |
ref_unit | A reference unit for the $teleport_unit auto-stored variable |
Definition at line 52 of file filter.hpp.
References match_impl().
|
private |
Definition at line 372 of file filter.cpp.
References vconfig::all_ordered(), cfg_, vconfig::child(), ERR_NG, fc_, filter_context::get_disp_context(), unit::get_location(), get_tiles_radius(), vconfig::has_child(), i, display_context::map(), match_impl(), match_internal(), filter_impl::matches(), max_loop_, gamemap_base::on_board(), terrain_filter(), and display_context::units().
Referenced by match(), and match_impl().
|
private |
Definition at line 96 of file filter.cpp.
References wfl::map_formula_callable::add(), terrain_filter::terrain_filter_cache::adjacent_match_cache, terrain_filter::terrain_filter_cache::adjacent_matches, map_location::all_directions(), variable_info< V >::as_array(), wfl::variant::as_bool(), cache_, cfg_, vconfig::child(), game_events::builtin_conditions::default_counts, e, config_attribute_value::empty(), ERR_WML, wfl::formula::evaluate(), fc_, 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(), display_context::get_team(), side_filter::get_teams(), 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(), utf8::index(), gamemap::is_village(), time_of_day::lawful_bonus, lg::log_to_chat(), main(), vconfig::make_safe(), display_context::map(), match_internal(), map_location::matches_range(), vconfig::null(), terrain_type::number(), gamemap_base::on_board(), gamemap_base::on_board_with_border(), team::owns_village(), map_location::parse_directions(), utils::parse_ranges_unsigned(), terrain_filter::terrain_filter_cache::parsed_terrain, game_lua_kernel::run_filter(), team::shrouded(), gamemap_base::special_location(), utils::split(), terrain_filter(), t_translation::terrain_matches(), config_attribute_value::to_int(), terrain_filter::terrain_filter_cache::ufilter_, display_context::units(), map_location::valid(), unit_map::iterator_base< iter_types >::valid(), display_context::village_owner(), and WRN_NG.
Referenced by get_locs_impl(), match_impl(), and match_internal().
|
inlinevirtual |
terrain_filter & terrain_filter::operator= | ( | const terrain_filter & | other | ) |
config terrain_filter::to_config | ( | ) | const |
Definition at line 669 of file filter.cpp.
References cfg_, vconfig::get_config(), and to_config().
Referenced by to_config().
|
friend |
Definition at line 81 of file filter.hpp.
|
mutableprivate |
Definition at line 105 of file filter.hpp.
Referenced by get_locs_impl(), and match_internal().
|
private |
Definition at line 87 of file filter.hpp.
Referenced by get_locs_impl(), match_impl(), match_internal(), and to_config().
|
private |
Definition at line 88 of file filter.hpp.
Referenced by get_locs_impl(), match_impl(), and match_internal().
|
private |
Definition at line 107 of file filter.hpp.
Referenced by flatten(), and match_internal().
|
private |
Definition at line 106 of file filter.hpp.
Referenced by get_locs_impl(), and match_impl().