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 () |
void | set_selection_candidate (unit_ptr candidate) |
Private Member Functions | |
unit_map & | get_unit_map () |
void | unhighlight () |
void | find_main_highlight () |
void | find_secondary_highlights () |
void | last_action_redraw (const 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 48 of file highlighter.cpp.
|
virtual |
Definition at line 60 of file highlighter.cpp.
References game_display::get_singleton(), owner_unit_, and unhighlight().
void wb::highlighter::clear | ( | ) |
Definition at line 120 of file highlighter.cpp.
References main_highlight_, owner_unit_, secondary_highlights_, selected_action_, and unhighlight().
Referenced by set_mouseover_hex().
|
private |
Definition at line 202 of file highlighter.cpp.
References wb::find_action_at(), main(), main_highlight_, mouseover_hex_, and owner_unit_.
Referenced by highlight().
|
private |
Definition at line 217 of file highlighter.cpp.
References utils::erase(), wb::find_actions_of(), main_highlight_, owner_unit_, and secondary_highlights_.
Referenced by highlight().
action_ptr wb::highlighter::get_bump_target | ( | ) |
Definition at line 254 of file highlighter.cpp.
References selected_action_.
action_ptr wb::highlighter::get_delete_target | ( | ) |
Definition at line 245 of file highlighter.cpp.
References selected_action_, and side_actions_.
action_ptr wb::highlighter::get_execute_target | ( | ) |
Definition at line 237 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 259 of file highlighter.cpp.
References owner_unit_, and selection_candidate_.
|
private |
Definition at line 348 of file highlighter.cpp.
References resources::gameboard, and game_board::units().
Referenced by set_mouseover_hex().
void wb::highlighter::highlight | ( | ) |
Definition at line 129 of file highlighter.cpp.
References wb::action::accept(), display::add_exclusive_draw(), exclusive_display_hexes_, find_main_highlight(), find_secondary_highlights(), display::get_singleton(), main(), main_highlight_, owner_unit_, and secondary_highlights_.
|
private |
Redraw the given move action when needed.
Definition at line 183 of file highlighter.cpp.
References wb::side_actions::begin(), wb::side_actions::end(), wb::side_actions::find_last_action_of(), resources::gameboard, wb::move::get_fake_unit(), wb::move::get_unit_id(), wb::action::team_index(), and game_board::teams().
Referenced by wb::highlighter::highlight_main_visitor::visit().
void wb::highlighter::set_mouseover_hex | ( | const map_location & | hex | ) |
Definition at line 69 of file highlighter.cpp.
References clear(), unit_map::find(), resources::gameboard, unit_map::iterator_base< iter_types >::get_shared_ptr(), get_unit_map(), mouseover_hex_, owner_unit_, utils::reversed_view(), selected_action_, selection_candidate_, side_actions_, and map_location::valid().
|
inline |
Definition at line 62 of file highlighter.hpp.
References selection_candidate_.
|
private |
Definition at line 160 of file highlighter.cpp.
References wb::action::accept(), exclusive_display_hexes_, display::get_singleton(), main(), main_highlight_, display::remove_exclusive_draw(), and secondary_highlights_.
Referenced by clear(), and ~highlighter().
|
private |
Definition at line 83 of file highlighter.hpp.
Referenced by highlight(), unhighlight(), and wb::highlighter::highlight_main_visitor::visit().
|
private |
Definition at line 88 of file highlighter.hpp.
Referenced by clear(), find_main_highlight(), find_secondary_highlights(), get_main_highlight(), highlight(), and unhighlight().
|
private |
Definition at line 82 of file highlighter.hpp.
Referenced by find_main_highlight(), get_mouseover_hex(), and set_mouseover_hex().
|
private |
Definition at line 84 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 89 of file highlighter.hpp.
Referenced by clear(), find_secondary_highlights(), get_secondary_highlights(), highlight(), and unhighlight().
|
private |
Definition at line 87 of file highlighter.hpp.
Referenced by clear(), get_bump_target(), get_delete_target(), get_execute_target(), and set_mouseover_hex().
|
private |
Definition at line 85 of file highlighter.hpp.
Referenced by get_selection_target(), set_mouseover_hex(), and set_selection_candidate().
|
private |
Definition at line 91 of file highlighter.hpp.
Referenced by get_delete_target(), get_execute_target(), and set_mouseover_hex().