game_events Namespace Reference

Domain specific events. More...


Classes

struct  manager
struct  entity_location

Functions

static bool unit_matches_filter (const unit &u, const vconfig filter, const gamemap::location &loc)
static bool matches_special_filter (const config *cfg, const vconfig filter)
game_stateget_state_of_game ()
static bool internal_conditional_passed (const unit_map *units, const vconfig cond, bool &backwards_compat)
bool conditional_passed (const unit_map *units, const vconfig cond, bool backwards_compat)
bool unit_matches_filter (unit_map::const_iterator itor, 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=gamemap::location::null_location, const entity_location &loc2=gamemap::location::null_location, const config &data=config())
 Function to fire an event.
void add_events (const config::child_list &cfgs, const std::string &id)
bool pump ()
Uint32 mutations ()

Variables

static config::child_list unit_wml_configs
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


Function Documentation

void game_events::add_events ( const config::child_list cfgs,
const std::string &  id 
)

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

bool game_events::fire ( const std::string &  event,
const entity_location &  loc1,
const entity_location &  loc2,
const config data 
)

game_state * game_events::get_state_of_game (  ) 

static bool game_events::internal_conditional_passed ( const unit_map units,
const vconfig  cond,
bool &  backwards_compat 
) [static]

bool game_events::matches_special_filter ( const config cfg,
const vconfig  filter 
) [static]

Todo:
FIXME: This filter should be deprecated and removed,

Definition at line 3008 of file game_events.cpp.

References vconfig::all_children_iterator::get_child(), vconfig::all_children_iterator::get_key(), vconfig::ordered_begin(), and vconfig::ordered_end().

Referenced by process_event().

Uint32 game_events::mutations (  ) 

Definition at line 3264 of file game_events.cpp.

References unit_mutations.

bool game_events::pump (  ) 

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

bool game_events::unit_matches_filter ( unit_map::const_iterator  itor,
const vconfig  filter 
)

Definition at line 3056 of file game_events.cpp.

bool game_events::unit_matches_filter ( const unit u,
const vconfig  filter,
const gamemap::location loc 
) [static]

void game_events::write_events ( config cfg  ) 


Variable Documentation

Definition at line 3061 of file game_events.cpp.

Referenced by add_events(), and game_events::manager::~manager().

std::set<std::string> game_events::unit_wml_ids [static]


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