21 #include <boost/range/adaptor/reversed.hpp>
55 , exclusive_display_hexes_()
57 , selection_candidate_()
60 , secondary_highlights_()
61 , side_actions_(side_actions)
118 if(act->is_numbering_hex(hex)) {
142 main->accept(hm_visitor);
171 main->accept(uh_visitor);
185 exclusive_display_hexes_.clear();
191 if(move->get_fake_unit()) {
196 bool this_is_last_action = last_action != sa.
end() && move == *last_action;
197 bool last_action_has_fake_unit = last_action != sa.
end() && (*last_action)->get_fake_unit();
198 bool this_is_second_to_last_action = (second_to_last_action != sa.
end() && move == *second_to_last_action);
200 if(this_is_last_action || (this_is_second_to_last_action && !last_action_has_fake_unit)) {
201 move->get_fake_unit()->anim_comp().set_standing(
true);
244 return *
side_actions_->find_first_action_of(*(locked->get_unit()));
252 return *
side_actions_->find_last_action_of(*(locked->get_unit()));
274 if(move->get_arrow()) {
277 if(move->get_fake_unit()) {
279 move->get_fake_unit()->anim_comp().set_ghosted(
true);
291 visit(boost::static_pointer_cast<move>(attack));
296 if(recruit->get_fake_unit()) {
301 highlighter_.exclusive_display_hexes_.insert(recruit->get_fake_unit()->get_location());
307 if(move->get_arrow()) {
310 if(move->get_fake_unit()) {
311 move->get_fake_unit()->anim_comp().set_ghosted(
true);
314 highlighter_.exclusive_display_hexes_.insert(move->get_fake_unit()->get_location());
316 highlighter_.last_action_redraw(move);
322 visit(boost::static_pointer_cast<move>(attack));
327 if(move->get_arrow()) {
330 if(move->get_fake_unit()) {
331 move->get_fake_unit()->anim_comp().set_disabled_ghosted(
false);
333 highlighter_.last_action_redraw(move);
339 visit(boost::static_pointer_cast<move>(attack));
344 if(recall->get_fake_unit()) {
349 highlighter_.exclusive_display_hexes_.insert(recall->get_fake_unit()->get_location());
container::iterator iterator
iterator end()
Returns the iterator for the position after the last executed action within the actions queue...
Arrows destined to be drawn on the map.
action_ptr get_delete_target()
side_actions_ptr side_actions_
weak_action_ptr main_highlight_
boost::shared_ptr< action > action_ptr
void find_main_highlight()
weak_action_ptr selected_action_
void find_secondary_highlights()
map_location mouseover_hex_
unit_map & get_unit_map()
Definitions for the interface to Wesnoth Markup Language (WML).
boost::weak_ptr< action > weak_action_ptr
iterator find_last_action_of(unit const &unit, iterator start_position)
Finds the last action that belongs to this unit, starting the search backwards from the specified pos...
unit_ptr selection_candidate_
static std::string at(const std::string &file, int line)
std::vector< team > * teams
highlighter(side_actions_ptr side_actions)
pointer get_shared_ptr() const
secondary_highlights_t secondary_highlights_
Encapsulates the map of the game.
std::map< std::string, tfilter >::iterator itor
void set_mouseover_hex(const map_location &hex)
highlighter & highlighter_
iterator begin()
Returns the iterator for the first (executed earlier) action within the actions queue.
bool add_exclusive_draw(const map_location &loc, unit &unit)
Allows a unit to request to be the only one drawn in its hex.
std::deque< action_ptr > find_actions_of(unit const &target)
Find the actions of an unit.
int main(int argc, char **argv)
action_ptr get_bump_target()
unit_ptr get_selection_target()
std::set< map_location > exclusive_display_hexes_
Container associating units to locations.
const std::string remove
remove directive
unit_iterator find(size_t id)
void last_action_redraw(move_ptr)
Redraw the given move action when needed.
virtual void accept(visitor &v)=0
Ensures that the real unit map is active for the duration of the struct's life.
action_ptr get_execute_target()
Abstract base class for all the whiteboard planned actions.
action_ptr find_action_at(map_location hex, team_filter team_filter)
Find the first action occuring on a given hex.
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...
std::string remove_exclusive_draw(const map_location &loc)
Cancels an exclusive draw request.