#include "global.hpp"
#include "actions.hpp"
#include "construct_dialog.hpp"
#include "game_display.hpp"
#include "dialogs.hpp"
#include "game_errors.hpp"
#include "game_events.hpp"
#include "image.hpp"
#include "language.hpp"
#include "log.hpp"
#include "map.hpp"
#include "menu_events.hpp"
#include "game_preferences.hpp"
#include "replay.hpp"
#include "SDL_timer.h"
#include "sound.hpp"
#include "team.hpp"
#include "terrain_filter.hpp"
#include "unit_display.hpp"
#include "util.hpp"
#include "gettext.hpp"
#include "serialization/string_utils.hpp"
#include "wml_exception.hpp"
#include "foreach.hpp"
#include <cassert>
#include <cstdlib>
#include <deque>
#include <iostream>
#include <iterator>
#include <set>
#include <string>
Go to the source code of this file.
Namespaces | |
namespace | game_events |
Defines | |
#define | DBG_NG LOG_STREAM(debug, engine) |
#define | LOG_NG LOG_STREAM(info, engine) |
#define | WRN_NG LOG_STREAM(warn, engine) |
#define | ERR_NG LOG_STREAM(err, engine) |
#define | DBG_DP LOG_STREAM(debug, display) |
#define | LOG_DP LOG_STREAM(info, display) |
#define | ERR_CF LOG_STREAM(err, config) |
#define | LOG_NO LOG_STREAM(info, notifs) |
#define | WRN_NO LOG_STREAM(warn, notifs) |
#define | ERR_NO LOG_STREAM(err, notifs) |
Typedefs | |
typedef std::pair< std::string, config * > | wmi_command_change |
Functions | |
static void | show_wml_errors () |
Shows a summary of the errors encountered in WML thusfar, to avoid a lot of the same messages to be shown. | |
static bool | game_events::unit_matches_filter (const unit &u, const vconfig filter, const gamemap::location &loc) |
static bool | game_events::matches_special_filter (const config *cfg, const vconfig filter) |
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) |
bool | game_events::conditional_passed (const unit_map *units, const vconfig cond, bool backwards_compat) |
static bool | events_init () |
static gamemap::location | cfg_to_loc (const vconfig &cfg, int defaultx=0, int defaulty=0) |
static std::vector < gamemap::location > | multiple_locs (const vconfig cfg) |
static void | commit_new_handlers () |
static void | commit_wmi_commands () |
static bool | process_event (event_handler &handler, const queued_event &ev) |
bool | game_events::unit_matches_filter (unit_map::const_iterator itor, const vconfig filter) |
void | game_events::write_events (config &cfg) |
void | game_events::raise (const std::string &event, const entity_location &loc1, const entity_location &loc2, const config &data) |
bool | game_events::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 | game_events::add_events (const config::child_list &cfgs, const std::string &id) |
bool | game_events::pump () |
Uint32 | game_events::mutations () |
Variables | |
game_display * | screen = NULL |
soundsource::manager * | soundsources = NULL |
gamemap * | game_map = NULL |
unit_map * | units = NULL |
std::vector< team > * | teams = NULL |
game_state * | state_of_game = NULL |
gamestatus * | status_ptr = NULL |
int | floating_label = 0 |
Uint32 | unit_mutations = 0 |
std::vector< event_handler > | new_handlers |
std::vector< wmi_command_change > | wmi_command_changes |
const gui::msecs | prevent_misclick_duration = 10 |
const gui::msecs | average_frame_time = 30 |
std::set< std::string > | used_items |
std::deque< queued_event > | events_queue |
std::multimap< std::string, event_handler > | events_map |
static config::child_list | game_events::unit_wml_configs |
static std::set< std::string > | game_events::unit_wml_ids |
Definition in file game_events.cpp.
Definition at line 55 of file game_events.cpp.
#define DBG_NG LOG_STREAM(debug, engine) |
Definition at line 51 of file game_events.cpp.
#define ERR_CF LOG_STREAM(err, config) |
Definition at line 57 of file game_events.cpp.
#define ERR_NG LOG_STREAM(err, engine) |
Definition at line 54 of file game_events.cpp.
#define ERR_NO LOG_STREAM(err, notifs) |
Definition at line 61 of file game_events.cpp.
#define LOG_DP LOG_STREAM(info, display) |
Definition at line 56 of file game_events.cpp.
#define LOG_NG LOG_STREAM(info, engine) |
Definition at line 52 of file game_events.cpp.
#define LOG_NO LOG_STREAM(info, notifs) |
Definition at line 59 of file game_events.cpp.
#define WRN_NG LOG_STREAM(warn, engine) |
Definition at line 53 of file game_events.cpp.
Referenced by unit_map::add(), game_state::set_menu_items(), game_state::set_variables(), and variable_info::variable_info().
#define WRN_NO LOG_STREAM(warn, notifs) |
Definition at line 60 of file game_events.cpp.
typedef std::pair< std::string, config* > wmi_command_change [static] |
Definition at line 77 of file game_events.cpp.
static gamemap::location cfg_to_loc | ( | const vconfig & | cfg, | |
int | defaultx = 0 , |
|||
int | defaulty = 0 | |||
) | [static] |
static void @77::commit_new_handlers | ( | ) | [static] |
Definition at line 2838 of file game_events.cpp.
References boost::foreach_detail_::end(), LOG_NG, and new_handlers.
Referenced by game_events::pump().
static void @77::commit_wmi_commands | ( | ) | [static] |
Definition at line 2854 of file game_events.cpp.
References config::add_child(), wml_menu_item::command, config::empty(), boost::foreach_detail_::end(), LOG_NG, wml_menu_item::name, state_of_game, wmi_command_changes, and game_state::wml_menu_items.
Referenced by game_events::pump().
static bool events_init | ( | ) | [static] |
Definition at line 338 of file game_events.cpp.
References screen.
Referenced by game_events::pump(), and game_events::raise().
static std::vector<gamemap::location> multiple_locs | ( | const vconfig | cfg | ) | [static] |
static bool process_event | ( | event_handler & | handler, | |
const queued_event & | ev | |||
) | [static] |
Definition at line 2913 of file game_events.cpp.
References unit_map::end(), unit_map::find(), display::invalidate_all(), game_state::last_selected, game_events::matches_special_filter(), display::rebuild_all(), display::recalculate_minimap(), screen, state_of_game, game_events::unit_matches_filter(), and units.
Referenced by game_events::pump().
static void show_wml_errors | ( | ) | [static] |
Shows a summary of the errors encountered in WML thusfar, to avoid a lot of the same messages to be shown.
Identical messages are shown once, with (between braces) the number of times that message was encountered. The order in which the messages are shown does not need to be the order in which these messages are encountered. Messages are always written to std::cerr.
Definition at line 116 of file game_events.cpp.
References game_display::add_chat_message(), game_display::MESSAGE_PUBLIC, screen, and lg::wml_error.
Referenced by game_events::pump().
const gui::msecs average_frame_time = 30 [static] |
Definition at line 81 of file game_events.cpp.
Definition at line 436 of file game_events.cpp.
Definition at line 351 of file game_events.cpp.
Referenced by replay_network_sender::commit_and_sync(), create_cursor(), events::map_command_handler< events::console_handler >::dispatch(), events::console_handler::do_set_alias(), events::console_handler::do_set_var(), events::chat_command_handler::do_whisper(), reports::generate_report(), gui2::hover_callback(), game::load_next_scenario(), game::notify_new_host(), open_connection(), gui2::tcanvas::parse_cfg(), gui2::popup_callback(), mp::ui::process_network(), server::process_whisper(), game_events::raise(), ai_interface::recruit(), server::run(), map_editor::save_map(), mp::ui::send_chat_message(), events::chat_handler::send_command(), game::send_history(), game::send_observerjoins(), events::menu_handler::status_table(), replay_network_sender::sync_non_undoable(), game::take_side(), game::transfer_ai_sides(), and gamemap::write().
bool disabled_ |
Definition at line 434 of file game_events.cpp.
std::multimap<std::string,event_handler> events_map [static] |
Definition at line 456 of file game_events.cpp.
std::deque<queued_event> events_queue [static] |
Definition at line 354 of file game_events.cpp.
Referenced by game_events::pump(), game_events::raise(), and game_events::manager::~manager().
bool first_time_only_ |
Definition at line 433 of file game_events.cpp.
int floating_label = 0 [static] |
Definition at line 67 of file game_events.cpp.
Referenced by game_events::internal_conditional_passed(), game_events::manager::manager(), and game_events::manager::~manager().
std::string name |
Definition at line 348 of file game_events.cpp.
Referenced by terrain_builder::add_images_from_config(), cutter::add_sub_image(), simple_wml::node::apply_diff(), choose_track(), composer::compose(), default_generate_map(), do_replay_handle(), events::console_handler::do_set_var(), preferences::encounter_start_units(), play_controller::execute_command(), hotkey::execute_command(), play_controller::expand_autosaves(), gui2::tlistbox::finalize_setup(), help::generate_ability_topics(), generate_name(), help::generate_weapon_special_topics(), preprocessor_file::get_chunk(), mp::get_colour_string(), display::get_fog_shroud_graphics(), vconfig::get_parsed_config(), map_editor::terrain_palette::get_terrain_string(), init_textdomains(), game_events::internal_conditional_passed(), cutter::load_masks(), simple_wml::node::node(), open_font(), help::unit_topic_generator::operator()(), leader_list_manager::populate_leader_combo(), mp::connect::process_network_data(), ai::recruit_usage(), sdl_keysym_from_name(), gui2::tlistbox::set_scrollbar_button_status(), preferences::show_hotkeys_dialog(), dialogs::show_objectives(), validate_all_python_scripts(), write_compressed_internal(), and write_internal().
std::vector< std::string > names_ |
Definition at line 432 of file game_events.cpp.
std::vector< event_handler > new_handlers [static] |
const gui::msecs prevent_misclick_duration = 10 [static] |
Definition at line 80 of file game_events.cpp.
bool rebuild_screen_ |
Definition at line 435 of file game_events.cpp.
game_display* screen = NULL [static] |
Definition at line 65 of file game_events.cpp.
Referenced by gui::dialog::dialog(), game_display::draw(), map_editor::brush_bar::draw(), map_editor::terrain_palette::draw(), editor_display::draw(), display::draw_all_panels(), display::draw_border(), gui::slider::draw_contents(), gui::scrollbar::draw_contents(), mp::wait::leader_preview_pane::draw_contents(), help::help_text_area::draw_contents(), display::draw_init(), display::draw_minimap(), draw_panel(), events_init(), gui::dialog::get_frame(), gui::dialog::layout(), map_editor::load_tooltips(), game_events::manager::manager(), process_event(), game_events::pump(), display::scroll(), gui2::twindow::show(), help::show_help(), show_wml_errors(), map_editor::update_l_button_palette(), default_map_generator::user_config(), game_events::write_events(), and game_events::manager::~manager().
soundsource::manager* soundsources = NULL [static] |
game_state* state_of_game = NULL [static] |
Definition at line 70 of file game_events.cpp.
Referenced by commit_wmi_commands(), game_events::get_state_of_game(), game_events::internal_conditional_passed(), game_events::manager::manager(), process_event(), game_events::pump(), and game_events::manager::~manager().
gamestatus* status_ptr = NULL [static] |
Definition at line 71 of file game_events.cpp.
Referenced by game_events::internal_conditional_passed(), game_events::manager::manager(), and game_events::manager::~manager().
Definition at line 69 of file game_events.cpp.
Referenced by ai::analyze_potential_recruit_movements(), team::calculate_enemies(), team::calculate_is_enemy(), team::change_team(), team::copy_ally_shroud(), sample_ai::do_attacks(), formula_ai::execute_variant(), team::fogged(), team::get_side_colour_index(), is_observer(), teams_manager::is_observer(), game_events::manager::manager(), team::nteams(), team::shrouded(), teams_manager::teams_manager(), validate_side(), player_teams::village_owner(), dfool::dfool_ai::visible_units(), and teams_manager::~teams_manager().
Uint32 unit_mutations = 0 [static] |
Definition at line 68 of file game_events.cpp.
Referenced by dispatch_complex(), sample_ai::do_attacks(), sample_ai::do_moves(), extract_summary_data_from_save(), extract_summary_from_config(), help::generate_ability_topics(), help::generate_weapon_special_topics(), game_events::manager::manager(), unit_display::move_unit(), dfool::dfool_ai::play_turn(), process_event(), read_player(), unit_display::unit_attack(), and game_events::manager::~manager().
std::set<std::string> used_items [static] |
Definition at line 334 of file game_events.cpp.
Referenced by game_events::manager::manager(), and game_events::write_events().
std::vector< wmi_command_change > wmi_command_changes [static] |
Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |