Class 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. More... | |
Private Member Functions | |
void | process (side_actions &sa, side_actions::iterator action_it) |
Function called on each action. More... | |
void | post_visit_team (size_t turn) |
Function called after visiting a team. More... | |
void | pre_build () |
Does various preliminary actions on the unit map such as resetting moves for some units. More... | |
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_ |
std::set< unit const * > | has_invalid_actions_ |
std::list< side_actions::iterator > | invalid_actions_ |
Conserved invalid actions. More... | |
Class that collects and applies unit_map modifications from the actions it visits and reverts all changes on destruction.
Definition at line 40 of file mapbuilder.hpp.
wb::mapbuilder::mapbuilder | ( | unit_map & | unit_map | ) |
Definition at line 37 of file mapbuilder.cpp.
|
virtual |
Definition at line 49 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 89 of file mapbuilder.cpp.
References wb::has_actions(), next, wb::side_actions::num_turns(), post_visit_team(), pre_build(), process(), wb::team_has_visible_plan(), resources::teams, wb::side_actions::turn_begin(), and wb::side_actions::turn_end().
|
private |
Function called after visiting a team.
Definition at line 174 of file mapbuilder.cpp.
References acted_this_turn_, and applied_actions_this_turn_.
Referenced by build_map().
|
private |
Does various preliminary actions on the unit map such as resetting moves for some units.
Definition at line 57 of file mapbuilder.cpp.
References acted_this_turn_, resources::controller, play_controller::current_side(), resources::gameboard, removers_, resetters_, resources::teams, resources::units, and wb::viewer_team().
Referenced by build_map().
|
private |
Function called on each action.
Definition at line 116 of file mapbuilder.cpp.
References acted_this_turn_, applied_actions_, applied_actions_this_turn_, has_invalid_actions_, invalid_actions_, wb::action::LOCATION_OCCUPIED, wb::action::OK, wb::side_actions::remove_action(), wb::action::TOO_FAR, and unit_map_.
Referenced by build_map().
|
private |
Definition at line 197 of file mapbuilder.cpp.
References applied_actions_, and unit_map_.
Referenced by ~mapbuilder().
|
private |
Definition at line 74 of file mapbuilder.hpp.
Referenced by post_visit_team(), pre_build(), and process().
|
private |
Definition at line 66 of file mapbuilder.hpp.
Referenced by process(), and restore_normal_map().
|
private |
Definition at line 67 of file mapbuilder.hpp.
Referenced by post_visit_team(), and process().
|
private |
Definition at line 75 of file mapbuilder.hpp.
Referenced by process().
|
private |
|
private |
Definition at line 71 of file mapbuilder.hpp.
Referenced by pre_build().
|
private |
Definition at line 70 of file mapbuilder.hpp.
Referenced by pre_build().
|
private |
Definition at line 64 of file mapbuilder.hpp.
Referenced by process(), and restore_normal_map().