events::mouse_handler Class Reference

#include <mouse_events.hpp>

Collaboration diagram for events::mouse_handler:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 mouse_handler (game_display *gui, std::vector< team > &teams, unit_map &units, gamemap &map, gamestatus &status, undo_list &undo_stack, undo_list &redo_stack)
 ~mouse_handler ()
void set_team (const int team_number)
void mouse_motion (const SDL_MouseMotionEvent &event, const bool browse)
void mouse_update (const bool browse)
void mouse_press (const SDL_MouseButtonEvent &event, const bool browse)
void cycle_units (const bool browse, const bool reverse=false)
void cycle_back_units (const bool browse)
int get_path_turns () const
paths get_current_paths ()
const gamemap::locationget_last_hex () const
gamemap::location get_selected_hex () const
bool get_undo () const
bool get_show_menu () const
void set_path_turns (const int path_turns)
void set_current_paths (paths new_paths)
void set_selected_hex (gamemap::location hex)
void deselect_hex ()
void invalidate_reachmap ()
void set_gui (game_display *gui)
void set_undo (const bool undo)
unit_map::iterator selected_unit ()
paths::route get_route (unit_map::const_iterator un, gamemap::location go_to, team &team)

Static Public Member Functions

static mouse_handlerget_singleton ()

Private Member Functions

teamviewing_team ()
const teamviewing_team () const
teamcurrent_team ()
void mouse_motion (int x, int y, const bool browse, bool update=false)
bool is_left_click (const SDL_MouseButtonEvent &event)
bool is_middle_click (const SDL_MouseButtonEvent &event)
bool is_right_click (const SDL_MouseButtonEvent &event)
void left_click (const SDL_MouseButtonEvent &event, const bool browse)
void select_hex (const gamemap::location &hex, const bool browse)
void clear_undo_stack ()
bool move_unit_along_current_route (bool check_shroud, bool attackmove=false)
bool attack_enemy (unit_map::iterator attacker, unit_map::iterator defender)
bool attack_enemy_ (unit_map::iterator attacker, unit_map::iterator defender)
void show_attack_options (unit_map::const_iterator u)
gamemap::location current_unit_attacks_from (const gamemap::location &loc)
unit_map::const_iterator find_unit (const gamemap::location &hex) const
unit_map::iterator find_unit (const gamemap::location &hex)
bool unit_in_cycle (unit_map::const_iterator it)

Private Attributes

game_displaygui_
std::vector< team > & teams_
unit_mapunits_
gamemapmap_
gamestatusstatus_
undo_listundo_stack_
undo_listredo_stack_
bool minimap_scrolling_
bool dragging_
bool dragging_started_
int drag_from_x_
int drag_from_y_
gamemap::location last_hex_
gamemap::location previous_hex_
gamemap::location previous_free_hex_
gamemap::location selected_hex_
gamemap::location next_unit_
paths::route current_route_
paths current_paths_
bool enemy_paths_
int path_turns_
unsigned int team_num_
bool enemies_visible_
bool undo_
bool show_menu_
bool over_route_
bool attackmove_
bool reachmap_invalid_
bool show_partial_move_

Static Private Attributes

static mouse_handlersingleton_ = NULL


Detailed Description

Definition at line 38 of file mouse_events.hpp.


Constructor & Destructor Documentation

events::mouse_handler::mouse_handler ( game_display gui,
std::vector< team > &  teams,
unit_map units,
gamemap map,
gamestatus status,
undo_list undo_stack,
undo_list redo_stack 
)

events::mouse_handler::~mouse_handler (  ) 

Definition at line 711 of file mouse_events.cpp.

References singleton_.


Member Function Documentation

static mouse_handler* events::mouse_handler::get_singleton (  )  [inline, static]

Definition at line 43 of file mouse_events.hpp.

References singleton_.

Referenced by unit_display::move_unit(), and unit_display::unit_die().

void events::mouse_handler::set_team ( const int  team_number  ) 

Definition at line 716 of file mouse_events.cpp.

References team_num_.

Referenced by play_controller::init_side().

void events::mouse_handler::mouse_motion ( const SDL_MouseMotionEvent &  event,
const bool  browse 
)

Definition at line 721 of file mouse_events.cpp.

Referenced by play_controller::handle_event(), and mouse_update().

void events::mouse_handler::mouse_update ( const bool  browse  ) 

Definition at line 726 of file mouse_events.cpp.

References mouse_motion().

Referenced by cycle_units(), mouse_press(), and play_controller::play_slice().

void events::mouse_handler::mouse_press ( const SDL_MouseButtonEvent &  event,
const bool  browse 
)

void events::mouse_handler::cycle_units ( const bool  browse,
const bool  reverse = false 
)

void events::mouse_handler::cycle_back_units ( const bool  browse  )  [inline]

Definition at line 50 of file mouse_events.hpp.

References cycle_units().

Referenced by play_controller::cycle_back_units().

int events::mouse_handler::get_path_turns (  )  const [inline]

Definition at line 52 of file mouse_events.hpp.

References path_turns_.

Referenced by play_controller::handle_event().

paths events::mouse_handler::get_current_paths (  )  [inline]

Definition at line 53 of file mouse_events.hpp.

References current_paths_.

Referenced by play_controller::handle_event().

const gamemap::location& events::mouse_handler::get_last_hex (  )  const [inline]

gamemap::location events::mouse_handler::get_selected_hex (  )  const [inline]

bool events::mouse_handler::get_undo (  )  const [inline]

Definition at line 56 of file mouse_events.hpp.

References undo_.

Referenced by play_controller::handle_event().

bool events::mouse_handler::get_show_menu (  )  const [inline]

Definition at line 57 of file mouse_events.hpp.

References show_menu_.

Referenced by play_controller::handle_event().

void events::mouse_handler::set_path_turns ( const int  path_turns  )  [inline]

Definition at line 58 of file mouse_events.hpp.

References path_turns_.

Referenced by play_controller::handle_event().

void events::mouse_handler::set_current_paths ( paths  new_paths  ) 

void events::mouse_handler::set_selected_hex ( gamemap::location  hex  )  [inline]

Definition at line 60 of file mouse_events.hpp.

References selected_hex_.

void events::mouse_handler::deselect_hex (  ) 

void events::mouse_handler::invalidate_reachmap (  )  [inline]

Definition at line 62 of file mouse_events.hpp.

References reachmap_invalid_.

Referenced by unit_display::move_unit(), and unit_display::unit_die().

void events::mouse_handler::set_gui ( game_display gui  )  [inline]

Definition at line 64 of file mouse_events.hpp.

References gui_.

Referenced by play_controller::init().

void events::mouse_handler::set_undo ( const bool  undo  )  [inline]

Definition at line 65 of file mouse_events.hpp.

References undo_.

Referenced by play_controller::handle_event().

unit_map::iterator events::mouse_handler::selected_unit (  ) 

paths::route events::mouse_handler::get_route ( unit_map::const_iterator  un,
gamemap::location  go_to,
team team 
)

team& events::mouse_handler::viewing_team (  )  [inline, private]

Definition at line 70 of file mouse_events.hpp.

References teams_.

Referenced by find_unit(), get_route(), mouse_motion(), and select_hex().

const team& events::mouse_handler::viewing_team (  )  const [inline, private]

Definition at line 71 of file mouse_events.hpp.

References teams_.

team& events::mouse_handler::current_team (  )  [inline, private]

void events::mouse_handler::mouse_motion ( int  x,
int  y,
const bool  browse,
bool  update = false 
) [private]

bool events::mouse_handler::is_left_click ( const SDL_MouseButtonEvent &  event  )  [private]

Definition at line 1087 of file mouse_events.cpp.

References events::command_active().

Referenced by mouse_press().

bool events::mouse_handler::is_middle_click ( const SDL_MouseButtonEvent &  event  )  [private]

Definition at line 1092 of file mouse_events.cpp.

Referenced by mouse_press().

bool events::mouse_handler::is_right_click ( const SDL_MouseButtonEvent &  event  )  [private]

Definition at line 1097 of file mouse_events.cpp.

References events::command_active().

Referenced by mouse_press().

void events::mouse_handler::left_click ( const SDL_MouseButtonEvent &  event,
const bool  browse 
) [private]

void events::mouse_handler::select_hex ( const gamemap::location hex,
const bool  browse 
) [private]

void events::mouse_handler::clear_undo_stack (  )  [private]

Definition at line 1267 of file mouse_events.cpp.

References apply_shroud_changes(), gui_, map_, team_num_, teams_, undo_stack_, and units_.

Referenced by attack_enemy_(), and left_click().

bool events::mouse_handler::move_unit_along_current_route ( bool  check_shroud,
bool  attackmove = false 
) [private]

bool events::mouse_handler::attack_enemy ( unit_map::iterator  attacker,
unit_map::iterator  defender 
) [private]

Definition at line 1327 of file mouse_events.cpp.

References attack_enemy_(), and lg::wml_error.

Referenced by left_click().

bool events::mouse_handler::attack_enemy_ ( unit_map::iterator  attacker,
unit_map::iterator  defender 
) [private]

void events::mouse_handler::show_attack_options ( unit_map::const_iterator  u  )  [private]

gamemap::location events::mouse_handler::current_unit_attacks_from ( const gamemap::location loc  )  [private]

unit_map::const_iterator events::mouse_handler::find_unit ( const gamemap::location hex  )  const [private]

unit_map::iterator events::mouse_handler::find_unit ( const gamemap::location hex  )  [private]

Definition at line 917 of file mouse_events.cpp.

References find_visible_unit(), map_, teams_, units_, and viewing_team().

bool events::mouse_handler::unit_in_cycle ( unit_map::const_iterator  it  )  [private]


Member Data Documentation

std::vector<team>& events::mouse_handler::teams_ [private]

Definition at line 97 of file mouse_events.hpp.

Referenced by attack_enemy_().

Definition at line 98 of file mouse_events.hpp.

Referenced by clear_undo_stack(), and move_unit_along_current_route().

Definition at line 99 of file mouse_events.hpp.

Referenced by attack_enemy_(), and move_unit_along_current_route().

Definition at line 101 of file mouse_events.hpp.

Referenced by left_click(), mouse_handler(), mouse_motion(), and mouse_press().

Definition at line 102 of file mouse_events.hpp.

Referenced by left_click(), mouse_handler(), mouse_motion(), and mouse_press().

Definition at line 103 of file mouse_events.hpp.

Referenced by left_click(), mouse_handler(), mouse_motion(), and mouse_press().

Definition at line 104 of file mouse_events.hpp.

Referenced by mouse_handler(), mouse_motion(), and mouse_press().

Definition at line 105 of file mouse_events.hpp.

Referenced by mouse_handler(), mouse_motion(), and mouse_press().

Definition at line 108 of file mouse_events.hpp.

Referenced by get_last_hex(), left_click(), mouse_motion(), mouse_press(), and selected_unit().

Definition at line 111 of file mouse_events.hpp.

Referenced by current_unit_attacks_from(), and mouse_motion().

Definition at line 112 of file mouse_events.hpp.

Referenced by current_unit_attacks_from(), and mouse_motion().

Definition at line 114 of file mouse_events.hpp.

Referenced by cycle_units(), move_unit_along_current_route(), and select_hex().

Definition at line 117 of file mouse_events.hpp.

Referenced by mouse_handler(), mouse_motion(), and select_hex().

unsigned int events::mouse_handler::team_num_ [private]

Definition at line 123 of file mouse_events.hpp.

Definition at line 124 of file mouse_events.hpp.

Referenced by get_undo(), left_click(), mouse_handler(), and set_undo().

Definition at line 125 of file mouse_events.hpp.

Referenced by get_show_menu(), mouse_handler(), and mouse_press().

Definition at line 126 of file mouse_events.hpp.

Referenced by mouse_handler(), and mouse_motion().

Definition at line 128 of file mouse_events.hpp.

Referenced by invalidate_reachmap(), mouse_handler(), and mouse_motion().

Definition at line 131 of file mouse_events.hpp.

Referenced by get_singleton(), mouse_handler(), and ~mouse_handler().


The documentation for this class was generated from the following files:

Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs