Class that handles highlighting planned actions as you hover over them and determine the right target for contextual execution. More...
#include <highlighter.hpp>
Classes | |
class | highlight_main_visitor |
class | highlight_secondary_visitor |
class | unhighlight_visitor |
Public Types | |
typedef std::deque < weak_action_ptr > | secondary_highlights_t |
Public Member Functions | |
highlighter (side_actions_ptr side_actions) | |
virtual | ~highlighter () |
void | set_mouseover_hex (const map_location &hex) |
const map_location & | get_mouseover_hex () const |
void | highlight () |
void | clear () |
action_ptr | get_execute_target () |
action_ptr | get_delete_target () |
action_ptr | get_bump_target () |
unit_ptr | get_selection_target () |
weak_action_ptr | get_main_highlight () |
secondary_highlights_t | get_secondary_highlights () |
Private Member Functions | |
unit_map & | get_unit_map () |
void | unhighlight () |
void | find_main_highlight () |
void | find_secondary_highlights () |
void | last_action_redraw (move_ptr) |
Redraw the given move action when needed. More... | |
Class that handles highlighting planned actions as you hover over them and determine the right target for contextual execution.
Definition at line 38 of file highlighter.hpp.
typedef std::deque<weak_action_ptr> wb::highlighter::secondary_highlights_t |
Definition at line 58 of file highlighter.hpp.
wb::highlighter::highlighter | ( | side_actions_ptr | side_actions | ) |
Definition at line 53 of file highlighter.cpp.
|
virtual |
Definition at line 65 of file highlighter.cpp.
References owner_unit_, resources::screen, and unhighlight().
void wb::highlighter::clear | ( | ) |
Definition at line 125 of file highlighter.cpp.
References main_highlight_, owner_unit_, secondary_highlights_, selected_action_, and unhighlight().
Referenced by set_mouseover_hex().
|
private |
Definition at line 206 of file highlighter.cpp.
References wb::find_action_at(), main(), main_highlight_, mouseover_hex_, and owner_unit_.
Referenced by highlight().
|
private |
Definition at line 221 of file highlighter.cpp.
References wb::find_actions_of(), main_highlight_, owner_unit_, schema_validation::remove, and secondary_highlights_.
Referenced by highlight().
action_ptr wb::highlighter::get_bump_target | ( | ) |
Definition at line 258 of file highlighter.cpp.
References selected_action_.
action_ptr wb::highlighter::get_delete_target | ( | ) |
Definition at line 249 of file highlighter.cpp.
References selected_action_, and side_actions_.
action_ptr wb::highlighter::get_execute_target | ( | ) |
Definition at line 241 of file highlighter.cpp.
References selected_action_, and side_actions_.
|
inline |
Definition at line 57 of file highlighter.hpp.
References main_highlight_.
|
inline |
Definition at line 46 of file highlighter.hpp.
References mouseover_hex_.
|
inline |
Definition at line 60 of file highlighter.hpp.
References secondary_highlights_.
unit_ptr wb::highlighter::get_selection_target | ( | ) |
Definition at line 263 of file highlighter.cpp.
References owner_unit_, and selection_candidate_.
|
private |
Definition at line 352 of file highlighter.cpp.
References resources::units.
Referenced by set_mouseover_hex().
void wb::highlighter::highlight | ( | ) |
Definition at line 134 of file highlighter.cpp.
References wb::action::accept(), display::add_exclusive_draw(), exclusive_display_hexes_, find_main_highlight(), find_secondary_highlights(), main(), main_highlight_, owner_unit_, resources::screen, and secondary_highlights_.
Redraw the given move action when needed.
Definition at line 188 of file highlighter.cpp.
References wb::side_actions::begin(), wb::side_actions::end(), wb::side_actions::find_last_action_of(), and resources::teams.
Referenced by wb::highlighter::highlight_main_visitor::visit().
void wb::highlighter::set_mouseover_hex | ( | const map_location & | hex | ) |
Definition at line 74 of file highlighter.cpp.
References schema_validation::at(), clear(), unit_map::find(), unit_map::iterator_base< iter_types >::get_shared_ptr(), get_unit_map(), itor, mouseover_hex_, owner_unit_, selected_action_, selection_candidate_, side_actions_, resources::teams, and map_location::valid().
|
private |
Definition at line 165 of file highlighter.cpp.
References wb::action::accept(), exclusive_display_hexes_, main(), main_highlight_, display::remove_exclusive_draw(), resources::screen, and secondary_highlights_.
Referenced by clear(), and ~highlighter().
|
private |
Definition at line 81 of file highlighter.hpp.
Referenced by highlight(), unhighlight(), and wb::highlighter::highlight_main_visitor::visit().
|
private |
Definition at line 86 of file highlighter.hpp.
Referenced by clear(), find_main_highlight(), find_secondary_highlights(), get_main_highlight(), highlight(), and unhighlight().
|
private |
Definition at line 80 of file highlighter.hpp.
Referenced by find_main_highlight(), get_mouseover_hex(), and set_mouseover_hex().
|
private |
Definition at line 82 of file highlighter.hpp.
Referenced by clear(), find_main_highlight(), find_secondary_highlights(), get_selection_target(), highlight(), set_mouseover_hex(), and ~highlighter().
|
private |
Definition at line 87 of file highlighter.hpp.
Referenced by clear(), find_secondary_highlights(), get_secondary_highlights(), highlight(), and unhighlight().
|
private |
Definition at line 85 of file highlighter.hpp.
Referenced by clear(), get_bump_target(), get_delete_target(), get_execute_target(), and set_mouseover_hex().
|
private |
Definition at line 83 of file highlighter.hpp.
Referenced by get_selection_target(), and set_mouseover_hex().
|
private |
Definition at line 89 of file highlighter.hpp.
Referenced by get_delete_target(), get_execute_target(), and set_mouseover_hex().