Angband
|
Allows the registering of handlers to be told about game events. More...
#include "z-type.h"
Go to the source code of this file.
Data Structures | |
union | game_event_data |
Macros | |
#define | N_GAME_EVENTS EVENT_END + 1 |
Typedefs | |
typedef enum game_event_type | game_event_type |
The various events we can send signals about. More... | |
typedef void | game_event_handler(game_event_type type, game_event_data *data, void *user) |
A function called when a game event occurs - these are registered to be called by event_add_handler or event_add_handler_set, and deregistered when they should no longer be called through event_remove_handler or event_remove_handler_set. More... | |
Allows the registering of handlers to be told about game events.
Copyright (c) 2007 Antony Sidwell
This work is free software; you can redistribute it and/or modify it under the terms of either:
a) the GNU General Public License as published by the Free Software Foundation, version 2, or
b) the "Angband licence": This software may be copied and distributed for educational, research, and not for profit purposes provided that this copyright and statement are included in all such copies. Other copyrights may also apply.
#define N_GAME_EVENTS EVENT_END + 1 |
Referenced by event_remove_all_handlers().
typedef void game_event_handler(game_event_type type, game_event_data *data, void *user) |
A function called when a game event occurs - these are registered to be called by event_add_handler or event_add_handler_set, and deregistered when they should no longer be called through event_remove_handler or event_remove_handler_set.
typedef enum game_event_type game_event_type |
The various events we can send signals about.
enum game_event_type |
The various events we can send signals about.
void event_add_handler | ( | game_event_type | type, |
game_event_handler * | fn, | ||
void * | user | ||
) |
References event_handler_entry::fn, mem_alloc(), NULL, type, and event_handler_entry::user.
Referenced by event_add_handler_set(), init_display(), init_sound(), point_based_start(), setup_tests(), subwindow_flag_changed(), test_prefs(), ui_enter_game(), ui_enter_init(), ui_enter_world(), ui_init_birthstate_handlers(), ui_leave_world(), and use_store().
void event_add_handler_set | ( | game_event_type * | type, |
size_t | n_types, | ||
game_event_handler * | fn, | ||
void * | user | ||
) |
References event_add_handler(), and i.
Referenced by subwindow_flag_changed(), and ui_enter_world().
References mem_free(), N_GAME_EVENTS, event_handler_entry::next, NULL, and type.
Referenced by cleanup_angband().
void event_remove_handler | ( | game_event_type | type, |
game_event_handler * | fn, | ||
void * | user | ||
) |
References mem_free(), event_handler_entry::next, NULL, prev, and type.
Referenced by event_remove_handler_set(), point_based_stop(), subwindow_flag_changed(), ui_leave_game(), ui_leave_init(), ui_leave_world(), and use_store().
void event_remove_handler_set | ( | game_event_type * | type, |
size_t | n_types, | ||
game_event_handler * | fn, | ||
void * | user | ||
) |
References event_remove_handler(), and i.
Referenced by subwindow_flag_changed(), and ui_leave_world().
void event_remove_handler_type | ( | game_event_type | type | ) |
References mem_free(), event_handler_entry::next, NULL, and type.
Referenced by do_cmd_hold(), and move_player().
void event_signal | ( | game_event_type | ) |
References game_event_dispatch(), and NULL.
Referenced by brand_object(), cheat_death(), check_devices(), check_for_player_interrupt(), close_game(), cmd_get_string(), colors_browse_hook(), combine_pack(), death_file(), death_screen(), display_object_recall_interactive(), display_winner(), disturb(), do_cmd_accept_character(), do_cmd_autopickup(), do_cmd_buy(), do_cmd_cast(), do_cmd_change_name(), do_cmd_disarm_aux(), do_cmd_disarm_chest(), do_cmd_hold(), do_cmd_lock_door(), do_cmd_open_aux(), do_cmd_open_chest(), do_cmd_prev_stats(), do_cmd_redraw(), do_cmd_retrieve(), do_cmd_roll_stats(), do_cmd_save_screen_html(), do_cmd_sell(), do_cmd_stash(), do_cmd_wiz_features(), do_cmd_wiz_query(), do_cmd_wizard(), dump_pref_file(), enchant_spell(), enter_score(), enter_store(), get_char(), get_character_name(), get_com_ex(), init_angband(), inven_drop(), keymap_browse_hook(), keymap_get_trigger(), leave_store(), lore_show_interactive(), move_player(), on_leave_level(), on_new_level(), player_pickup_item(), print_error(), process_player(), recalculate_stats(), redraw_stuff(), run_game_loop(), save_game(), screen_load(), screen_save(), see_floor_items(), show_file(), spell_cast(), spoiler_menu_act(), start_game(), store_menu_handle(), take_hit(), textui_cmd_debug(), textui_cmd_suicide(), textui_get_check(), textui_get_item(), textui_get_rep_dir(), textui_get_string(), textui_store_knowledge(), update_player_object_knowledge(), update_stuff(), use_store(), visuals_browse_hook(), visuals_reset(), wiz_cheat_death(), and wiz_statistics().
References game_event_data::birthstats, data, EVENT_BIRTHPOINTS, game_event_dispatch(), game_event_data::remaining, stats, and game_event_data::stats.
Referenced by buy_stat(), do_cmd_roll_stats(), generate_stats(), reset_stats(), and sell_stat().
void event_signal_blast | ( | game_event_type | type, |
int | proj_type, | ||
int | num_grids, | ||
int * | distance_to_grid, | ||
bool | seen, | ||
bool * | player_sees_grid, | ||
struct loc * | blast_grid, | ||
struct loc | centre | ||
) |
References game_event_data::blast_grid, game_event_data::centre, data, game_event_data::distance_to_grid, game_event_data::drawing, game_event_data::explosion, game_event_dispatch(), game_event_data::num_grids, game_event_data::player_sees_grid, and game_event_data::proj_type.
Referenced by project().
void event_signal_flag | ( | game_event_type | type, |
bool | flag | ||
) |
References data, game_event_data::flag, flag, and game_event_dispatch().
Referenced by do_cmd_birth_init().
void event_signal_message | ( | game_event_type | type, |
int | t, | ||
const char * | s | ||
) |
References data, game_event_dispatch(), game_event_data::message, game_event_data::msg, and game_event_data::type.
Referenced by bell(), init_angband(), init_arrays(), init_game_constants(), msg(), msgt(), note(), run_parse_lore(), run_template_parser(), sound(), store_init(), and textui_init().
void event_signal_missile | ( | game_event_type | type, |
struct object * | obj, | ||
bool | seen, | ||
int | y, | ||
int | x | ||
) |
References data, game_event_dispatch(), game_event_data::missile, game_event_data::obj, game_event_data::seen, game_event_data::x, and game_event_data::y.
Referenced by ranged_helper().
void event_signal_point | ( | game_event_type | , |
int | x, | ||
int | y | ||
) |
References data, game_event_dispatch(), game_event_data::point, loc::x, and loc::y.
Referenced by display_bolt(), display_explosion(), display_missile(), disturb(), redraw_stuff(), and square_light_spot().
void event_signal_string | ( | game_event_type | , |
const char * | s | ||
) |
References data, game_event_dispatch(), and game_event_data::string.