Visitor that collects and applies unit_map modifications from the actions it visits and reverts all changes on destruction. More...
#include <mapbuilder.hpp>


Public Member Functions | |
| mapbuilder (unit_map &unit_map) | |
| virtual | ~mapbuilder () |
| void | build_map () |
| builds every team's actions as far into the future as possible, in the correct order | |
Private Member Functions | |
| bool | process (size_t team_index, team &, side_actions &, side_actions::iterator) |
| bool | pre_visit_team (size_t turn, size_t team_index, team &, side_actions &) |
| visit(): | |
| bool | post_visit_team (size_t turn, size_t team_index, team &, side_actions &) |
| bool | process_helper (side_actions::iterator const &, action_ptr const &) |
| virtual void | validate (side_actions::iterator const &) |
| void | pre_build () |
| void | restore_normal_map () |
Private Attributes | |
| unit_map & | unit_map_ |
| action_queue | applied_actions_ |
| action_queue | applied_actions_this_turn_ |
| boost::ptr_vector < unit_movement_resetter > | resetters_ |
| boost::ptr_vector < temporary_unit_remover > | removers_ |
| std::set< unit const * > | acted_this_turn_ |
Friends | |
| class | enable_visit_all< mapbuilder > |
Visitor that collects and applies unit_map modifications from the actions it visits and reverts all changes on destruction.
Definition at line 37 of file mapbuilder.hpp.
| wb::mapbuilder::mapbuilder | ( | unit_map & | unit_map | ) |
Definition at line 36 of file mapbuilder.cpp.
| wb::mapbuilder::~mapbuilder | ( | ) | [virtual] |
Definition at line 46 of file mapbuilder.cpp.
References restore_normal_map().

| void wb::mapbuilder::build_map | ( | ) |
builds every team's actions as far into the future as possible, in the correct order
Definition at line 86 of file mapbuilder.cpp.
References wb::has_actions(), pre_build(), and wb::enable_visit_all< mapbuilder >::visit_all().
Referenced by wb::validate_visitor::validate_actions().


| bool wb::mapbuilder::post_visit_team | ( | size_t | , | |
| size_t | , | |||
| team & | , | |||
| side_actions & | ||||
| ) | [private] |
Reimplemented from wb::enable_visit_all< mapbuilder >.
Definition at line 142 of file mapbuilder.cpp.
References acted_this_turn_, and applied_actions_this_turn_.
| void wb::mapbuilder::pre_build | ( | ) | [private] |
Definition at line 52 of file mapbuilder.cpp.
References acted_this_turn_, resources::controller, play_controller::current_side(), unit::get_location(), team::get_side_actions(), unit::is_visible_to_team(), removers_, resetters_, unit::side(), resources::teams, resources::units, and wb::viewer_team().
Referenced by build_map().


| bool wb::mapbuilder::pre_visit_team | ( | size_t | , | |
| size_t | , | |||
| team & | , | |||
| side_actions & | sa | |||
| ) | [private] |
visit():
Reimplemented from wb::enable_visit_all< mapbuilder >.
Definition at line 137 of file mapbuilder.cpp.
References wb::side_actions::hidden().

| bool wb::mapbuilder::process | ( | size_t | team_index, | |
| team & | , | |||
| side_actions & | , | |||
| side_actions::iterator | action_it | |||
| ) | [private] |
Definition at line 109 of file mapbuilder.cpp.
References acted_this_turn_, unit::movement_left(), process_helper(), unit::set_movement(), and unit::total_movement().

| bool wb::mapbuilder::process_helper | ( | side_actions::iterator const & | itor, | |
| action_ptr const & | act | |||
| ) | [private] |
Definition at line 95 of file mapbuilder.cpp.
References applied_actions_, applied_actions_this_turn_, unit_map_, and validate().
Referenced by process().


| void wb::mapbuilder::restore_normal_map | ( | ) | [private] |
Definition at line 168 of file mapbuilder.cpp.
References applied_actions_, and unit_map_.
Referenced by ~mapbuilder().

| virtual void wb::mapbuilder::validate | ( | side_actions::iterator const & | ) | [inline, private, virtual] |
Reimplemented in wb::validate_visitor::helper.
Definition at line 58 of file mapbuilder.hpp.
Referenced by process_helper().

friend class enable_visit_all< mapbuilder > [friend] |
Definition at line 40 of file mapbuilder.hpp.
std::set<unit const*> wb::mapbuilder::acted_this_turn_ [private] |
Definition at line 75 of file mapbuilder.hpp.
Referenced by post_visit_team(), pre_build(), and process().
action_queue wb::mapbuilder::applied_actions_ [private] |
Definition at line 67 of file mapbuilder.hpp.
Referenced by process_helper(), and restore_normal_map().
Definition at line 68 of file mapbuilder.hpp.
Referenced by post_visit_team(), and process_helper().
boost::ptr_vector<temporary_unit_remover> wb::mapbuilder::removers_ [private] |
Definition at line 72 of file mapbuilder.hpp.
Referenced by pre_build().
boost::ptr_vector<unit_movement_resetter> wb::mapbuilder::resetters_ [private] |
Definition at line 71 of file mapbuilder.hpp.
Referenced by pre_build().
unit_map& wb::mapbuilder::unit_map_ [private] |
Definition at line 65 of file mapbuilder.hpp.
Referenced by process_helper(), and restore_normal_map().
| Generated by doxygen 1.7.1 on Thu May 24 2012 01:26:31 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |