Classes | Typedefs | Functions | Variables

game_events Namespace Reference

Domain specific events. More...

Classes

struct  manager
struct  entity_location
struct  queued_event
class  event_handler

Typedefs

typedef void(* action_handler )(const game_events::queued_event &, const vconfig &)

Functions

static bool matches_special_filter (const config &cfg, const vconfig &filter)
static bool internal_conditional_passed (const vconfig &cond, bool &backwards_compat)
bool conditional_passed (const vconfig &cond, bool backwards_compat)
void handle_wml_log_message (const config &cfg)
 Used for [wml_message].
void handle_deprecated_message (const config &cfg)
 Used for [deprecated_message].
std::vector< int > get_sides_vector (const vconfig &cfg)
 Gets a vector of sides from side= attribute in a given config node.
void handle_event_commands (const queued_event &event_info, const vconfig &cfg)
 Runs the action handler associated to the command sequence cfg.
void handle_event_command (const std::string &cmd, const queued_event &event_info, const vconfig &cfg)
 Runs the action handler associated to cmd with parameters cfg.
bool unit_matches_filter (const unit &u, const vconfig &filter)
void write_events (config &cfg)
void raise (const std::string &event, const entity_location &loc1, const entity_location &loc2, const config &data)
bool fire (const std::string &event, const entity_location &loc1=map_location::null_location, const entity_location &loc2=map_location::null_location, const config &data=config())
 Function to fire an event.
void add_events (const config::const_child_itors &cfgs, const std::string &type)
void commit ()
 Handles newly-created handlers.
bool pump ()

Variables

static std::set< std::string > unit_wml_ids

Detailed Description

Domain specific events.

This module defines the game's event mechanism. Events might be units moving or fighting, or when victory or defeat occurs. A scenario's configuration file will define actions to take when certain events occur. This module is responsible for making sure that when the events occur, the actions take place.

Game events have nothing to do with mouse movement, keyboard events, etc. These kinds of system events can be handled using namespace events


Typedef Documentation

Definition at line 157 of file game_events.hpp.


Function Documentation

void game_events::add_events ( const config::const_child_itors cfgs,
const std::string &  type 
)

Referenced by unit::advance_to(), play_controller::init(), replay_controller::reset_replay(), and unit::unit().

Here is the caller graph for this function:

void game_events::commit (  ) 

Handles newly-created handlers.

Flushes WML messages and errors.

Referenced by events::console_handler::do_lua().

Here is the caller graph for this function:

bool game_events::conditional_passed ( const vconfig cond,
bool  backwards_compat 
)

Deprecated:
r18803 [or] syntax
Todo:
For now we will re-interpret it according to the old rules, but this should be later to prevent re-interpretation errors.

Referenced by play_controller::expand_wml_commands(), intf_eval_conditional(), process_event(), storyscreen::part::resolve_wml(), storyscreen::controller::resolve_wml(), and WML_HANDLER_FUNCTION().

Here is the caller graph for this function:

bool game_events::fire ( const std::string &  event,
const entity_location &  loc1 = map_location::null_location,
const entity_location &  loc2 = map_location::null_location,
const config data = config() 
)
std::vector< int > game_events::get_sides_vector ( const vconfig cfg  ) 

Gets a vector of sides from side= attribute in a given config node.

Promotes consistent behaviour.

Referenced by toggle_shroud(), and WML_HANDLER_FUNCTION().

Here is the caller graph for this function:

void game_events::handle_deprecated_message ( const config cfg  ) 

Used for [deprecated_message].

Referenced by storyscreen::part::resolve_wml(), storyscreen::controller::resolve_wml(), and WML_HANDLER_FUNCTION().

Here is the caller graph for this function:

void game_events::handle_event_command ( const std::string &  cmd,
const game_events::queued_event event_info,
const vconfig cfg 
)

Runs the action handler associated to cmd with parameters cfg.

Referenced by events::menu_handler::objectives().

Here is the caller graph for this function:

void game_events::handle_event_commands ( const game_events::queued_event event_info,
const vconfig cfg 
)

Runs the action handler associated to the command sequence cfg.

Referenced by game_events::event_handler::handle_event(), and WML_HANDLER_FUNCTION().

Here is the caller graph for this function:

void game_events::handle_wml_log_message ( const config cfg  ) 

Used for [wml_message].

Referenced by storyscreen::part::resolve_wml(), storyscreen::controller::resolve_wml(), and WML_HANDLER_FUNCTION().

Here is the caller graph for this function:

static bool game_events::internal_conditional_passed ( const vconfig cond,
bool &  backwards_compat 
) [static]
bool game_events::matches_special_filter ( const config cfg,
const vconfig filter 
) [static]

Definition at line 3374 of file game_events.cpp.

References vconfig::all_children_iterator::get_child(), vconfig::all_children_iterator::get_key(), vconfig::get_parsed_config(), attack_type::matches_filter(), vconfig::ordered_begin(), vconfig::ordered_end(), and WRN_NG.

Referenced by process_event().

Here is the call graph for this function:

Here is the caller graph for this function:

bool game_events::pump (  ) 

Referenced by apply_shroud_changes(), clear_shroud(), and recalculate_fog().

Here is the caller graph for this function:

void game_events::raise ( const std::string &  event,
const entity_location &  loc1,
const entity_location &  loc2,
const config data 
)

Referenced by apply_shroud_changes().

Here is the caller graph for this function:

bool game_events::unit_matches_filter ( const unit u,
const vconfig filter 
)

Referenced by internal_conditional_passed(), process_event(), unit_display::wml_animation_internal(), and WML_HANDLER_FUNCTION().

Here is the caller graph for this function:

void game_events::write_events ( config cfg  ) 

Variable Documentation

std::set<std::string> game_events::unit_wml_ids [static]
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Fri May 25 2012 01:19:50 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs