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, bool is_local_side) |
| Function called on each action. More... | |
| void | post_visit_team (std::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_ |
| std::vector< std::unique_ptr< unit_movement_resetter > > | resetters_ |
| std::vector< std::unique_ptr< 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 38 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 resources::gameboard, wb::has_actions(), post_visit_team(), pre_build(), process(), and wb::team_has_visible_plan().
|
private |
Function called after visiting a team.
Definition at line 177 of file mapbuilder.cpp.
References acted_this_turn_, applied_actions_this_turn_, wb::move::get_route(), wb::move::get_unit(), utils::views::reverse, wb::move::set_turn_number(), and pathfind::marked_route::steps.
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, display::get_singleton(), removers_, resetters_, t, and display::viewing_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_, wb::action::apply_temp_modifier(), wb::action::check_validity(), wb::action::get_unit(), has_invalid_actions_, invalid_actions_, wb::action::LOCATION_OCCUPIED, wb::action::OK, wb::action::places_new_unit(), wb::action::redraw(), wb::side_actions::remove_action(), unit::set_movement(), wb::action::TOO_FAR, unit::total_movement(), and unit_map_.
Referenced by build_map().
|
private |
Definition at line 200 of file mapbuilder.cpp.
References applied_actions_, utils::views::reverse, and unit_map_.
Referenced by ~mapbuilder().
|
private |
Definition at line 72 of file mapbuilder.hpp.
Referenced by post_visit_team(), pre_build(), and process().
|
private |
Definition at line 64 of file mapbuilder.hpp.
Referenced by process(), and restore_normal_map().
|
private |
Definition at line 65 of file mapbuilder.hpp.
Referenced by post_visit_team(), and process().
|
private |
Definition at line 73 of file mapbuilder.hpp.
Referenced by process().
|
private |
|
private |
Definition at line 69 of file mapbuilder.hpp.
Referenced by pre_build().
|
private |
Definition at line 68 of file mapbuilder.hpp.
Referenced by pre_build().
|
private |
Definition at line 62 of file mapbuilder.hpp.
Referenced by process(), and restore_normal_map().