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(std::size_t turn=0; !stop; ++turn) {
105 std::advance(next, 1);
106 process(actions, it, side.is_local());
157 if((**it)->get_unit().get() == unit.get()) {
168 if(acted || action->places_new_unit()) {
179 std::set<unit const*> seen;
184 move_ptr move = std::dynamic_pointer_cast<
class move>(action);
187 if(move->get_route().steps.size() > 1 && seen.count(move->get_unit().get()) == 0) {
188 seen.insert(move->get_unit().get());
189 move->set_turn_number(turn + 1);
virtual void set_turn_number(int turn)
Assigns a turn number to display to this planned move.
container::iterator iterator
play_controller * controller
bool team_has_visible_plan(team &t)
Returns whether a given team's plan is visible.
void set_movement(int moves, bool unit_action=false)
Set this unit's remaining movement to moves.
virtual const std::vector< team > & teams() const override
This class represents a single unit of a specific type.
auto reversed_view(T &container)
bool has_actions()
Return whether the whiteboard has actions.
std::set< unit const * > acted_this_turn_
std::set< unit const * > has_invalid_actions_
std::vector< std::unique_ptr< unit_movement_resetter > > resetters_
std::shared_ptr< unit > unit_ptr
void process(side_actions &sa, side_actions::iterator action_it, bool is_local_side)
Function called on each action.
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).
std::shared_ptr< action > action_ptr
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.
iterator turn_begin(std::size_t turn_num)
std::list< side_actions::iterator > invalid_actions_
Conserved invalid actions.
void post_visit_team(std::size_t turn)
Function called after visiting a team.
std::shared_ptr< move > move_ptr
iterator turn_end(std::size_t turn_num)
action_queue applied_actions_this_turn_
int current_side() const
Returns the number of the side whose turn it is.
Container associating units to locations.
void build_map()
Builds every team's actions as far into the future as possible, in the correct order.
std::size_t num_turns() const
Returns the number of turns that have plans.
Abstract base class for all the whiteboard planned actions.
std::vector< std::unique_ptr< temporary_unit_remover > > removers_
This internal whiteboard class holds the planned action queues for a team, and offers many utility me...
std::string::const_iterator iterator
A planned move, represented on the map by an arrow and a ghosted unit in the destination hex...
std::size_t viewer_team()