32 #include <boost/range/adaptor/reversed.hpp>
40 , applied_actions_this_turn_()
44 , has_invalid_actions_()
61 t.get_side_actions()->reset_gold_spent();
66 bool on_current_side = (u.side() == current_side);
97 for(
size_t turn=0; !
end; ++turn) {
105 std::advance(
next, 1);
127 unit->set_movement(unit->total_movement());
155 if((**it)->get_unit().get() == unit.get()) {
176 std::set<unit const*> seen;
181 move_ptr move = boost::dynamic_pointer_cast<
class move>(action);
183 move->set_turn_number(0);
184 if(move->get_route().steps.size() > 1 && seen.count(move->get_unit().get()) == 0) {
185 seen.insert(move->get_unit().get());
186 move->set_turn_number(turn + 1);
container::iterator iterator
play_controller * controller
bool team_has_visible_plan(team &t)
Returns whether a given team's plan is visible.
void process(side_actions &sa, side_actions::iterator action_it)
Function called on each action.
iterator turn_begin(size_t turn_num)
bool has_actions()
Return whether the whiteboard has actions.
std::set< unit const * > acted_this_turn_
boost::ptr_vector< temporary_unit_remover > removers_
std::set< unit const * > has_invalid_actions_
void restore_normal_map()
iterator remove_action(iterator position, bool validate_after_delete=true)
Deletes the action at the specified position.
void pre_build()
Does various preliminary actions on the unit map such as resetting moves for some units...
This class stores all the data for a single 'side' (in game nomenclature).
size_t num_turns() const
Returns the number of turns that have plans.
int current_side() const
Returns the number of the side whose turn it is.
std::vector< team > * teams
boost::ptr_vector< unit_movement_resetter > resetters_
Object which temporarily resets a unit's movement.
mapbuilder(unit_map &unit_map)
action_queue applied_actions_
This object is used to temporary remove a unit from the unit map.
std::list< side_actions::iterator > invalid_actions_
Conserved invalid actions.
iterator turn_end(size_t turn_num)
action_queue applied_actions_this_turn_
Container associating units to locations.
void build_map()
Builds every team's actions as far into the future as possible, in the correct order.
Abstract base class for all the whiteboard planned actions.
This internal whiteboard class holds the planned action queues for a team, and offers many utility me...
A planned move, represented on the map by an arrow and a ghosted unit in the destination hex...
void post_visit_team(size_t turn)
Function called after visiting a team.