#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 |
![]() | |
filter_impl () | |
virtual bool | matches (const gamemap_base &m, map_location l)=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 | |
![]() | |
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 51 of file filter.cpp.
References terrain_filter().
Referenced by operator=(), and terrain_filter().
terrain_filter::terrain_filter | ( | const vconfig & | cfg, |
const terrain_filter & | original | ||
) |
Definition at line 60 of file filter.cpp.
References cache_, cfg_, fc_, flat_, max_loop_, and terrain_filter().
terrain_filter::~terrain_filter | ( | ) |
Default implementation, but defined out-of-line for efficiency reasons.
Definition at line 47 of file filter.cpp.
References ~terrain_filter().
Referenced by ~terrain_filter().
terrain_filter::terrain_filter | ( | const terrain_filter & | other | ) |
Definition at line 69 of file filter.cpp.
References cache_, cfg_, fc_, flat_, max_loop_, and terrain_filter().
|
inline |
Definition at line 78 of file filter.hpp.
References flat_, and to_config().
|
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().
|
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 514 of file filter.cpp.
References ERR_NG, terrain_filterimpl::filter_area(), terrain_filterimpl::filter_special_loc(), terrain_filterimpl::filter_xy(), unit::get_location(), get_locs_impl(), get_tiles_radius(), h, i, utils::split(), map_location::valid(), and 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 operator()().
|
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 373 of file filter.cpp.
References ERR_NG, unit::get_location(), get_tiles_radius(), i, and match_impl().
Referenced by match(), and match_impl().
|
private |
Definition at line 97 of file filter.cpp.
References wfl::map_formula_callable::add(), variable_info< V >::as_array(), wfl::variant::as_bool(), vconfig::child(), game_events::builtin_conditions::default_counts, map_location::default_dirs(), e, config_attribute_value::empty(), ERR_WML, wfl::formula::evaluate(), wfl::formula_error::filename, team::fogged(), get_adjacent_tiles(), side_filter::get_teams(), i, time_of_day::id, in_ranges(), utf8::index(), time_of_day::lawful_bonus, wfl::formula_error::line, lg::log_to_chat(), main(), match_internal(), map_location::matches_range(), vconfig::null(), map_location::parse_directions(), utils::parse_ranges(), team::shrouded(), utils::split(), t_translation::terrain_matches(), config_attribute_value::to_int(), wfl::formula_error::type, map_location::valid(), unit_map::iterator_base< iter_types >::valid(), and WRN_NG.
Referenced by match_internal().
|
inlinevirtual |
terrain_filter & terrain_filter::operator= | ( | const terrain_filter & | other | ) |
Definition at line 80 of file filter.cpp.
References operator=(), and terrain_filter().
Referenced by operator=().
config terrain_filter::to_config | ( | ) | const |
Definition at line 670 of file filter.cpp.
References to_config().
Referenced by flatten(), and to_config().
|
friend |
Definition at line 81 of file filter.hpp.
|
mutableprivate |
Definition at line 105 of file filter.hpp.
Referenced by terrain_filter().
|
private |
Definition at line 87 of file filter.hpp.
Referenced by terrain_filter().
|
private |
Definition at line 88 of file filter.hpp.
Referenced by terrain_filter().
|
private |
Definition at line 107 of file filter.hpp.
Referenced by flatten(), and terrain_filter().
|
private |
Definition at line 106 of file filter.hpp.
Referenced by terrain_filter().