50 , exclusive_display_hexes_()
52 , selection_candidate_()
55 , secondary_highlights_()
113 if(act->is_numbering_hex(hex)) {
137 main->accept(hm_visitor);
166 main->accept(uh_visitor);
192 bool this_is_last_action = last_action != sa.
end() &&
move == *last_action;
193 bool last_action_has_fake_unit = last_action != sa.
end() && (*last_action)->get_fake_unit();
194 bool this_is_second_to_last_action = (second_to_last_action != sa.
end() &&
move == *second_to_last_action);
196 if(this_is_last_action || (this_is_second_to_last_action && !last_action_has_fake_unit)) {
240 return *
side_actions_->find_first_action_of(locked->get_unit_id());
248 return *
side_actions_->find_last_action_of(locked->get_unit_id());
287 visit(std::static_pointer_cast<move>(
attack));
310 highlighter_.exclusive_display_hexes_.insert(
move->
get_fake_unit()->get_location());
312 highlighter_.last_action_redraw(
move);
318 visit(std::static_pointer_cast<move>(
attack));
329 highlighter_.last_action_redraw(
move);
335 visit(std::static_pointer_cast<move>(
attack));
bool add_exclusive_draw(const map_location &loc, const unit &unit)
Allows a unit to request to be the only one drawn in its hex.
std::string remove_exclusive_draw(const map_location &loc)
Cancels an exclusive draw request.
static display * get_singleton()
Returns the display object if a display object exists.
virtual const std::vector< team > & teams() const override
virtual const unit_map & units() const override
static game_display * get_singleton()
Container associating units to locations.
unit_iterator find(std::size_t id)
Abstract base class for all the whiteboard planned actions.
std::size_t team_index() const
Returns the index of the team that owns this action.
virtual void accept(visitor &v)=0
highlighter & highlighter_
side_actions_ptr side_actions_
void find_main_highlight()
std::set< map_location > exclusive_display_hexes_
action_ptr get_bump_target()
secondary_highlights_t secondary_highlights_
unit_ptr selection_candidate_
action_ptr get_execute_target()
void set_mouseover_hex(const map_location &hex)
map_location mouseover_hex_
void last_action_redraw(const move_ptr &)
Redraw the given move action when needed.
highlighter(side_actions_ptr side_actions)
unit_map & get_unit_map()
action_ptr get_delete_target()
weak_action_ptr selected_action_
unit_ptr get_selection_target()
void find_secondary_highlights()
weak_action_ptr main_highlight_
A planned move, represented on the map by an arrow and a ghosted unit in the destination hex.
virtual size_t get_unit_id() const
Returns the id of the unit targeted by this action.
void set_arrow_brightness(ARROW_BRIGHTNESS x) const
virtual fake_unit_ptr get_fake_unit()
virtual arrow_ptr get_arrow()
@ ARROW_BRIGHTNESS_STANDARD
@ ARROW_BRIGHTNESS_HIGHLIGHTED
virtual fake_unit_ptr get_fake_unit()
virtual fake_unit_ptr get_fake_unit()
This internal whiteboard class holds the planned action queues for a team, and offers many utility me...
iterator find_last_action_of(const unit &unit, iterator start_position)
Finds the last action that belongs to this unit, starting the search backwards from the specified pos...
iterator begin()
Returns the iterator for the first (executed earlier) action within the actions queue.
container::iterator iterator
iterator end()
Returns the iterator for the position after the last executed action within the actions queue.
auto reversed_view(T &container)
std::size_t erase(Container &container, const Value &value)
Convenience wrapper for using std::remove on a container.
std::shared_ptr< recruit > recruit_ptr
std::weak_ptr< action > weak_action_ptr
std::shared_ptr< move > move_ptr
std::shared_ptr< action > action_ptr
std::shared_ptr< attack > attack_ptr
action_ptr find_action_at(map_location hex, const team_filter &team_filter)
Find the first action occurring on a given hex.
std::shared_ptr< side_actions > side_actions_ptr
std::deque< action_ptr > find_actions_of(const unit &target)
Find the actions of an unit.
std::shared_ptr< recall > recall_ptr
std::shared_ptr< unit > unit_ptr
Encapsulates the map of the game.
pointer get_shared_ptr() const
This is exactly the same as operator-> but it's slightly more readable, and can replace &*iter syntax...
Ensures that the real unit map is active for the duration of the struct's life.