The Battle for Wesnoth  1.15.0+dev
Public Member Functions | Private Attributes | List of all members
game_events::event_handler Class Reference

#include <handlers.hpp>

Public Member Functions

 event_handler (config &&cfg, bool is_menu_item, const std::vector< std::string > &types)
 
const std::vector< std::string > & names () const
 
bool disabled () const
 
bool is_menu_item () const
 
void disable ()
 Flag this handler as disabled. More...
 
void handle_event (const queued_event &event_info, game_lua_kernel &)
 Handles the queued event, according to our WML instructions. More...
 
const configget_config () const
 

Private Attributes

bool first_time_only_
 
bool is_menu_item_
 
bool disabled_
 
config cfg_
 
std::vector< std::string > types_
 

Detailed Description

Definition at line 37 of file handlers.hpp.

Constructor & Destructor Documentation

◆ event_handler()

game_events::event_handler::event_handler ( config &&  cfg,
bool  is_menu_item,
const std::vector< std::string > &  types 
)

Definition at line 44 of file handlers.cpp.

Member Function Documentation

◆ disable()

void game_events::event_handler::disable ( )

Flag this handler as disabled.

Definition at line 53 of file handlers.cpp.

References disabled_.

Referenced by handle_event(), and is_menu_item().

◆ disabled()

bool game_events::event_handler::disabled ( ) const
inline

Definition at line 47 of file handlers.hpp.

References disabled_.

◆ get_config()

const config& game_events::event_handler::get_config ( ) const
inline

Definition at line 67 of file handlers.hpp.

References cfg_.

Referenced by game_events::wml_event_pump::filter_event().

◆ handle_event()

void game_events::event_handler::handle_event ( const queued_event event_info,
game_lua_kernel lk 
)

Handles the queued event, according to our WML instructions.

Parameters
[in]event_infoInformation about the event that needs handling.

Definition at line 59 of file handlers.cpp.

References cfg_, sound::commit_music_changes(), DBG_NG, disable(), disabled_, first_time_only_, is_menu_item_, and game_lua_kernel::run_wml_action().

Referenced by is_menu_item().

◆ is_menu_item()

bool game_events::event_handler::is_menu_item ( ) const
inline

Definition at line 52 of file handlers.hpp.

References disable(), handle_event(), and is_menu_item_.

◆ names()

const std::vector<std::string>& game_events::event_handler::names ( ) const
inline

Definition at line 42 of file handlers.hpp.

References types_.

Member Data Documentation

◆ cfg_

config game_events::event_handler::cfg_
private

Definition at line 76 of file handlers.hpp.

Referenced by get_config(), and handle_event().

◆ disabled_

bool game_events::event_handler::disabled_
private

Definition at line 75 of file handlers.hpp.

Referenced by disable(), disabled(), and handle_event().

◆ first_time_only_

bool game_events::event_handler::first_time_only_
private

Definition at line 73 of file handlers.hpp.

Referenced by handle_event().

◆ is_menu_item_

bool game_events::event_handler::is_menu_item_
private

Definition at line 74 of file handlers.hpp.

Referenced by handle_event(), and is_menu_item().

◆ types_

std::vector<std::string> game_events::event_handler::types_
private

Definition at line 77 of file handlers.hpp.

Referenced by names().


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