#include <terrain_filter.hpp>


Classes | |
| struct | terrain_filter_cache |
Public Member Functions | |
| terrain_filter (const vconfig &cfg, const unit_map &units, 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. | |
| 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) |
| 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 unit_map & | units_ |
| terrain_filter_cache | cache_ |
| size_t | max_loop_ |
| bool | flat_ |
Definition at line 30 of file terrain_filter.hpp.
| terrain_filter::terrain_filter | ( | const vconfig & | cfg, | |
| const unit_map & | units, | |||
| const bool | flat_tod = false, |
|||
| const size_t | max_loop = game_config::max_loop | |||
| ) |
Definition at line 58 of file terrain_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 68 of file terrain_filter.cpp.
| terrain_filter::~terrain_filter | ( | ) |
Default implementation, but defined out-of-line for efficiency reasons.
Definition at line 36 of file terrain_filter.cpp.
Referenced by operator=().

| terrain_filter::terrain_filter | ( | const terrain_filter & | other | ) |
Definition at line 77 of file terrain_filter.cpp.
| void terrain_filter::flatten | ( | const bool | flat_tod = true |
) | [inline] |
Definition at line 63 of file terrain_filter.hpp.
References flat_.
Referenced by unit::ability_active().

| void terrain_filter::get_locations | ( | std::set< map_location > & | locs, | |
| bool | with_border = false | |||
| ) | const |
Definition at line 374 of file terrain_filter.cpp.
References terrain_filter::terrain_filter_cache::adjacent_matches, variable_info::as_array(), variable_info::as_container(), gamemap::border_size(), cache_, cfg_, cond(), ERR_NG, variable_info::explicit_index, resources::game_map, vconfig::all_children_iterator::get_child(), vconfig::get_children(), vconfig::all_children_iterator::get_key(), get_tiles_radius(), gamemap::h(), h, vconfig::has_attribute(), vconfig::has_child(), variable_info::is_valid, match_internal(), max_loop_, vconfig::ordered_begin(), vconfig::ordered_end(), parse_location_range(), terrain_filter(), variable_info::TYPE_CONTAINER, gamemap::w(), and w.
Referenced by ai::cfun_ai_get_avoid(), pathfind::teleport_group::get_teleport_pair(), ai::formula_ai::get_value(), intf_get_locations(), ai::readonly_context_impl::nearest_keep(), toggle_fog(), toggle_shroud(), unit_display::wml_animation_internal(), and WML_HANDLER_FUNCTION().


| bool terrain_filter::match | ( | const map_location & | loc | ) | const |
Definition at line 307 of file terrain_filter.cpp.
References cfg_, cond(), ERR_NG, resources::game_map, vconfig::all_children_iterator::get_child(), vconfig::all_children_iterator::get_key(), get_tiles_radius(), match_internal(), max_loop_, gamemap::on_board(), and terrain_filter().
Referenced by unit::ability_active(), ai::readonly_context_impl::calculate_moves(), unit::internal_matches_filter(), intf_match_location(), operator()(), ai::testing_ai_default::remove_wrong_targets::operator()(), ai::remove_wrong_targets::operator()(), and attack_type::special_active().


| bool terrain_filter::match_internal | ( | const map_location & | loc, | |
| const bool | ignore_xy | |||
| ) | const [private] |
Definition at line 106 of file terrain_filter.cpp.
References terrain_filter::terrain_filter_cache::adjacent_match_cache, terrain_filter::terrain_filter_cache::adjacent_matches, variable_info::as_array(), variable_info::as_container(), at(), cache_, cfg_, vconfig::child(), gui2::distance(), unit_map::end(), variable_info::explicit_index, gui2::event::find(), unit_map::find(), flat_, team::fogged(), resources::game_map, get_adjacent_tiles(), vconfig::get_children(), tod_manager::get_illuminated_time_of_day(), side_filter::get_teams(), gamemap::get_terrain_info(), tod_manager::get_time_of_day(), vconfig::has_attribute(), vconfig::has_child(), time_of_day::id, in_ranges(), t_translation::t_match::is_empty, variable_info::is_valid, time_of_day::lawful_bonus, map_location::matches_range(), vconfig::null(), terrain_type::number(), map_location::parse_directions(), utils::parse_ranges(), terrain_filter::terrain_filter_cache::parsed_terrain, team::shrouded(), utils::split(), resources::teams, terrain_filter(), t_translation::terrain_matches(), resources::tod_manager, variable_info::TYPE_CONTAINER, units_, village_owner(), and WRN_NG.
Referenced by get_locations(), and match().


| virtual bool terrain_filter::operator() | ( | const map_location & | loc | ) | [inline, virtual] |
Implements xy_pred.
Definition at line 51 of file terrain_filter.hpp.
References match().

| terrain_filter & terrain_filter::operator= | ( | const terrain_filter & | other | ) |
Definition at line 88 of file terrain_filter.cpp.
References terrain_filter(), and ~terrain_filter().

| void terrain_filter::restrict_size | ( | const size_t | max_loop | ) | [inline] |
Definition at line 60 of file terrain_filter.hpp.
References max_loop_.
| config terrain_filter::to_config | ( | ) | const |
Definition at line 516 of file terrain_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().


terrain_filter_cache terrain_filter::cache_ [mutable, private] |
Definition at line 92 of file terrain_filter.hpp.
Referenced by get_locations(), and match_internal().
const vconfig terrain_filter::cfg_ [private] |
Definition at line 69 of file terrain_filter.hpp.
Referenced by get_locations(), match(), match_internal(), and to_config().
bool terrain_filter::flat_ [private] |
Definition at line 94 of file terrain_filter.hpp.
Referenced by flatten(), and match_internal().
size_t terrain_filter::max_loop_ [private] |
Definition at line 93 of file terrain_filter.hpp.
Referenced by get_locations(), match(), and restrict_size().
const unit_map& terrain_filter::units_ [private] |
Definition at line 70 of file terrain_filter.hpp.
Referenced by match_internal().
| Generated by doxygen 1.7.1 on Thu May 24 2012 01:16:32 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |