#include <handlers.hpp>
Public Member Functions | |
event_handler (const config &cfg, bool is_menu_item, handler_vec::size_type index, manager &) | |
handler_vec::size_type | index () const |
The index of *this should only be of interest when controlling iterations. More... | |
bool | matches_name (const std::string &name, const game_data *data) const |
bool | is_menu_item () const |
void | disable () |
Disables *this, removing it from the game. More... | |
void | handle_event (const queued_event &event_info, handler_ptr &handler_p, game_lua_kernel &) |
Handles the queued event, according to our WML instructions. More... | |
const config & | get_config () const |
Private Attributes | |
bool | first_time_only_ |
bool | is_menu_item_ |
handler_vec::size_type | index_ |
manager * | man_ |
config | cfg_ |
Definition at line 52 of file handlers.hpp.
game_events::event_handler::event_handler | ( | const config & | cfg, |
bool | is_menu_item, | ||
handler_vec::size_type | index, | ||
manager & | man | ||
) |
Definition at line 78 of file handlers.cpp.
void game_events::event_handler::disable | ( | ) |
Disables *this, removing it from the game.
(Technically, the handler is only removed once no one is hanging on to a handler_ptr to *this. So be careful how long they persist.)
WARNING: *this may be destroyed at the end of this call, unless the caller maintains a handler_ptr to this.
Definition at line 94 of file handlers.cpp.
References game_events::manager::event_handlers_, index_, and man_.
Referenced by handle_event().
|
inline |
Definition at line 69 of file handlers.hpp.
References cfg_.
Referenced by game_events::t_pump::filter_event().
void game_events::event_handler::handle_event | ( | const queued_event & | event_info, |
handler_ptr & | handler_p, | ||
game_lua_kernel & | lk | ||
) |
Handles the queued event, according to our WML instructions.
WARNING: *this may be destroyed at the end of this call, unless the caller maintains a handler_ptr to this.
[in] | event_info | Information about the event that needs handling. |
[in,out] | handler_p | The caller's smart pointer to *this. It may be reset() during processing. |
Definition at line 113 of file handlers.cpp.
References cfg_, DBG_NG, disable(), first_time_only_, is_menu_item_, and game_lua_kernel::run_wml_action().
|
inline |
The index of *this should only be of interest when controlling iterations.
Definition at line 59 of file handlers.hpp.
References index_.
|
inline |
Definition at line 63 of file handlers.hpp.
References is_menu_item_.
bool game_events::event_handler::matches_name | ( | const std::string & | name, |
const game_data * | data | ||
) | const |
Definition at line 135 of file handlers.cpp.
References cfg_, gui2::event::find(), utils::interpolate_variables_into_string(), and itor.
|
private |
Definition at line 76 of file handlers.hpp.
Referenced by get_config(), handle_event(), and matches_name().
|
private |
Definition at line 72 of file handlers.hpp.
Referenced by handle_event().
|
private |
Definition at line 74 of file handlers.hpp.
|
private |
Definition at line 73 of file handlers.hpp.
Referenced by handle_event(), and is_menu_item().
|
private |
Definition at line 75 of file handlers.hpp.
Referenced by disable().