16 #ifndef MOUSE_EVENTS_H_INCLUDED
17 #define MOUSE_EVENTS_H_INCLUDED
27 #include <SDL_events.h>
44 void cycle_units(
const bool browse,
const bool reverse =
false);
84 const bool highlight =
true,
void set_current_paths(const pathfind::paths &new_paths)
int get_path_turns() const
int fill_weapon_choices(std::vector< battle_context > &bc_vector, unit_map::iterator attacker, unit_map::iterator defender)
void mouse_press(const SDL_MouseButtonEvent &event, const bool browse)
map_location selected_hex_
unit_map::const_iterator find_unit(const map_location &hex) const
pathfind::marked_route get_route(const unit *un, map_location go_to, team &team) const
pathfind::paths current_paths_
const pathfind::marked_route & get_current_route() const
bool move_unit_along_current_route()
Moves a unit along the currently cached route.
bool unit_in_cycle(unit_map::const_iterator it)
GLint GLint GLint GLint GLint GLint y
const map_location & get_last_hex() const
map_location previous_hex_
void mouse_motion(int x, int y, const bool browse, bool update=false, map_location loc=map_location::null_location())
Use update to force an update of the mouse state.
void select_hex(const map_location &hex, const bool browse, const bool highlight=true, const bool fire_event=true)
map_location get_selected_hex() const
static mouse_handler * singleton_
const game_display & gui() const
Const version.
This class stores all the data for a single 'side' (in game nomenclature).
static mouse_handler * get_singleton()
void set_path_turns(const int path_turns)
map_location current_unit_attacks_from(const map_location &loc) const
Computes the statistics of a battle between an attacker and a defender unit.
void invalidate_reachmap()
void set_gui(game_display *gui)
Structure which holds a single route and marks for special events.
static const map_location & null_location()
void mouse_wheel_right(int x, int y, const bool)
Called when the mouse wheel is scrolled right.
bool right_click_show_menu(int x, int y, const bool browse)
Called in the default right_click when the context menu is about to be shown, can be used for preproc...
Encapsulates the map of the game.
void cycle_back_units(const bool browse)
void left_mouse_up(int x, int y, const bool)
Called when the left mouse button is up.
void attack_enemy(const map_location &attacker_loc, const map_location &defender_loc, int choice)
unit_map::iterator selected_unit()
void save_whiteboard_attack(const map_location &attacker_loc, const map_location &defender_loc, int weapon_choice)
map_location previous_free_hex_
GLint GLint GLint GLint GLint x
mouse_handler(game_display *gui, play_controller &pc)
void cycle_units(const bool browse, const bool reverse=false)
bool fire_event(const tevent event, std::vector< std::pair< twidget *, tevent > > &event_chain, twidget *dispatcher, twidget *widget, F functor)
Helper function for fire_event.
Handling of system events.
size_t move_unit_along_route(const std::vector< map_location > &steps, bool &interrupted)
Moves a unit across the board for a player.
map_location last_hex_
last highlighted hex
int drag_threshold() const
void show_attack_options(const unit_map::const_iterator &u)
Causes attackable hexes to be highlighted.
void mouse_wheel_down(int x, int y, const bool)
Called when the mouse wheel is scrolled down.
pathfind::marked_route current_route_
Object which contains all the possible locations a unit can move to, with associated best routes to t...
void mouse_wheel_left(int x, int y, const bool)
Called when the mouse wheel is scrolled left.
void mouse_wheel_up(int x, int y, const bool)
Called when the mouse wheel is scrolled up.
void set_side(int side_number)
void attack_enemy_(const map_location &attacker_loc, const map_location &defender_loc, int choice)
const pathfind::paths & current_paths() const
game_display & gui()
Due to the way this class is constructed we can assume that the display* gui_ member actually points ...
This module contains various pathfinding functions and utilities.
std::set< map_location > get_adj_enemies(const map_location &loc, int side) const
int show_attack_dialog(const map_location &attacker_loc, const map_location &defender_loc)
void move_action(bool browse)
Overridden in derived class.
void select_or_action(bool browse)