#include <playmp_controller.hpp>
Classes | |
class | hotkey_handler |
Protected Member Functions | |
virtual void | handle_generic_event (const std::string &name) |
void | start_network () |
void | stop_network () |
virtual void | play_side_impl () |
virtual void | play_human_turn () |
virtual void | play_linger_turn () |
virtual void | after_human_turn () |
virtual void | play_network_turn () |
Will handle networked turns in descendent classes. More... | |
virtual void | do_idle_notification () |
Will handle sending a networked notification in descendent classes. More... | |
virtual void | play_idle_loop () |
void | linger () |
void | wait_for_upload () |
Wait for the host to upload the next scenario. More... | |
virtual void | on_not_observer () |
bool | is_host () const |
void | remove_blindfold () |
Protected Member Functions inherited from playsingle_controller | |
void | before_human_turn () |
void | show_turn_dialog () |
void | execute_gotos () |
void | end_turn_enable (bool enable) |
void | play_ai_turn () |
virtual void | init_gui () |
void | store_recalls () |
void | store_gold (bool obs=false) |
void | linger () |
void | sync_end_turn () |
void | update_viewing_player () |
void | reset_replay () |
Protected Member Functions inherited from play_controller | |
void | play_slice_catch () |
bool | have_keyboard_focus () |
Derived classes should override this to return false when arrow keys should not scroll the map, hotkeys not processed etc, for example when a textbox is active. More... | |
void | process_focus_keydown_event (const SDL_Event &event) |
Process keydown (only when the general map display does not have focus). More... | |
void | process_keydown_event (const SDL_Event &event) |
Process keydown (always). More... | |
void | process_keyup_event (const SDL_Event &event) |
Process keyup (always). More... | |
void | init_managers () |
void | fire_preload () |
preload events cannot be synced More... | |
void | fire_prestart () |
void | fire_start () |
void | start_game () |
void | finish_side_turn () |
void | finish_turn () |
bool | enemies_visible () const |
void | enter_textbox () |
void | tab () |
bool | is_team_visible (int team_num, bool observer) const |
int | find_last_visible_team () const |
returns 0 if no such team was found. More... | |
actions::undo_list & | undo_stack () |
const actions::undo_list & | undo_stack () const |
const std::string & | select_victory_music () const |
const std::string & | select_defeat_music () const |
void | set_victory_music_list (const std::string &list) |
void | set_defeat_music_list (const std::string &list) |
void | reset_gamestate (const config &level, int replay_pos) |
virtual void | check_time_over () |
void | play_turn () |
Protected Member Functions inherited from controller_base | |
virtual std::vector< std::string > | additional_actions_pressed () |
bool | handle_scroll (int mousex, int mousey, int mouse_flags, double joystickx, double joysticky) |
Handle scrolling by keyboard, joystick and moving mouse near map edges. More... | |
void | handle_event (const SDL_Event &event) |
Process mouse- and keypress-events from SDL. More... | |
void | handle_window_event (const SDL_Event &) |
virtual void | show_menu (const std::vector< std::string > &items_arg, int xloc, int yloc, bool context_menu, display &disp) |
virtual void | execute_action (const std::vector< std::string > &items_arg, int xloc, int yloc, bool context_menu) |
virtual bool | in_context_menu (hotkey::HOTKEY_COMMAND command) const |
Protected Member Functions inherited from video2::draw_layering | |
draw_layering (const bool auto_join=true) | |
virtual | ~draw_layering () |
Protected Member Functions inherited from events::sdl_handler | |
sdl_handler (const bool auto_join=true) | |
virtual | ~sdl_handler () |
virtual std::vector < sdl_handler * > | handler_members () |
Private Member Functions | |
void | set_end_scenario_button () |
void | reset_end_scenario_button () |
void | process_network_data () |
Private Attributes | |
mp_campaign_info * | mp_info_ |
Additional Inherited Members | |
Static Public Member Functions inherited from controller_base | |
static const config & | get_theme (const config &game_config, std::string theme_name) |
Static Public Member Functions inherited from quit_confirmation | |
static bool | quit () |
Shows the quit confirmation if needed. More... | |
static void | quit_to_title () |
static void | quit_to_desktop () |
static bool | show_prompt (const std::string &message) |
static bool | default_prompt () |
Protected Types inherited from playsingle_controller | |
enum | END_TURN_STATE { END_TURN_NONE, END_TURN_REQUIRED, END_TURN_SYNCED } |
Definition at line 24 of file playmp_controller.hpp.
playmp_controller::playmp_controller | ( | const config & | level, |
saved_game & | state_of_game, | ||
const config & | game_config, | ||
const tdata_cache & | tdata, | ||
CVideo & | video, | ||
mp_campaign_info * | mp_info | ||
) |
Definition at line 44 of file playmp_controller.cpp.
References events::generic_event::attach_handler(), turn_info::host_transfer(), play_controller::hotkey_handler_, mp_info_, play_controller::saved_game_, play_controller::skip_replay_, mp_campaign_info::skip_replay_until_turn, and playsingle_controller::turn_data_.
|
virtual |
Definition at line 65 of file playmp_controller.cpp.
References events::generic_event::detach_handler(), turn_info::host_transfer(), and playsingle_controller::turn_data_.
|
protectedvirtual |
Reimplemented from playsingle_controller.
Definition at line 308 of file playmp_controller.cpp.
References team::action_bonus_count(), replay::add_countdown_update(), playsingle_controller::after_human_turn(), team::countdown_time(), play_controller::current_side(), play_controller::current_team(), LOG_NG, mp_game_settings::mp_countdown, mp_game_settings::mp_countdown_action_bonus, mp_game_settings::mp_countdown_reservoir_time, mp_game_settings::mp_countdown_turn_bonus, saved_game::mp_settings(), resources::recorder, play_controller::saved_game_, turn_info::send_data(), team::set_action_bonus_count(), team::set_countdown_time(), and playsingle_controller::turn_data_.
Referenced by linger().
|
protectedvirtual |
Will handle sending a networked notification in descendent classes.
Reimplemented from playsingle_controller.
Definition at line 407 of file playmp_controller.cpp.
References _(), play_controller::gui_, and events::chat_handler::MESSAGE_PUBLIC.
|
protectedvirtual |
Reimplemented from playsingle_controller.
Definition at line 381 of file playmp_controller.cpp.
References playsingle_controller::end_turn_enable(), play_controller::gui_, playsingle_controller::handle_generic_event(), mp_campaign_info::is_host, play_controller::linger_, mp_info_, turn_info::send_data(), and playsingle_controller::turn_data_.
|
protected |
Definition at line 402 of file playmp_controller.cpp.
References mp_campaign_info::is_host, and mp_info_.
Referenced by maybe_linger(), play_linger_turn(), set_end_scenario_button(), and wait_for_upload().
|
overridevirtual |
Reimplemented from play_controller.
Definition at line 481 of file playmp_controller.cpp.
References mp_info_.
|
protected |
Definition at line 234 of file playmp_controller.cpp.
References after_human_turn(), game_state::board_, playsingle_controller::end_turn_, playsingle_controller::END_TURN_NONE, play_controller::gamestate(), play_controller::get_end_level_data_const(), play_controller::gui_, play_controller::is_regular_game_end(), game_display::LINGER, play_controller::linger_, LOG_NG, play_linger_turn(), quit_confirmation::quit(), reset_end_scenario_button(), turn_info::send_data(), game_board::set_all_units_user_end_turn(), set_end_scenario_button(), playsingle_controller::turn_data_, and play_controller::update_gui_to_player().
Referenced by playmp_controller::hotkey_handler::can_execute_command(), and maybe_linger().
|
virtual |
Reimplemented from playsingle_controller.
Definition at line 414 of file playmp_controller.cpp.
References game_state::gamedata_, play_controller::gamestate(), play_controller::get_end_level_data_const(), play_controller::gui_, is_host(), play_controller::is_regular_game_end(), linger(), game_data::next_scenario(), and wait_for_upload().
|
protectedvirtual |
Reimplemented from playsingle_controller.
Definition at line 89 of file playmp_controller.cpp.
References remove_blindfold().
|
protectedvirtual |
Reimplemented from playsingle_controller.
Definition at line 120 of file playmp_controller.cpp.
References _(), font::add_floating_label(), play_controller::can_undo(), playsingle_controller::check_objectives(), actions::undo_list::clear(), play_controller::current_team(), preferences::disable_auto_moves(), playsingle_controller::end_turn_, playsingle_controller::end_turn_enable(), playsingle_controller::END_TURN_REQUIRED, playsingle_controller::execute_gotos(), replay_helper::get_update_shroud(), play_controller::gui_, play_controller::linger_, LOG_NG, mp_game_settings::mp_countdown, saved_game::mp_settings(), play_controller::play_slice_catch(), play_controller::player_type_changed_, process_network_data(), remove_blindfold(), synced_context::run_and_store(), play_controller::saved_game_, turn_info::send_data(), font::floating_label::set_clip_rect(), font::floating_label::set_color(), font::floating_label::set_lifetime(), font::floating_label::set_position(), playsingle_controller::should_return_to_play_side(), playsingle_controller::show_turn_dialog(), playsingle_controller::turn_data_, actions::undo_list::undo(), and play_controller::undo_stack().
|
protectedvirtual |
Reimplemented from playsingle_controller.
Definition at line 189 of file playmp_controller.cpp.
References play_controller::gui_, LOG_NG, play_controller::play_slice_catch(), process_network_data(), remove_blindfold(), turn_info::send_data(), playsingle_controller::should_return_to_play_side(), and playsingle_controller::turn_data_.
|
protectedvirtual |
Definition at line 101 of file playmp_controller.cpp.
References playsingle_controller::end_turn(), playsingle_controller::end_turn_, playsingle_controller::end_turn_enable(), playsingle_controller::END_TURN_NONE, play_controller::gui_, is_host(), playsingle_controller::network_reader_, controller_base::play_slice(), turn_info::PROCESS_END_LINGER, turn_info::process_network_data(), playturn_network_adapter::read(), and playsingle_controller::turn_data_.
Referenced by linger().
|
protectedvirtual |
Will handle networked turns in descendent classes.
Reimplemented from playsingle_controller.
Definition at line 330 of file playmp_controller.cpp.
References playsingle_controller::end_turn_, playsingle_controller::end_turn_enable(), playsingle_controller::END_TURN_SYNCED, play_controller::gui_, play_controller::is_regular_game_end(), LOG_NG, mp_info_, network_processing_stopped_, play_controller::play_slice_catch(), play_controller::player_type_changed_, process_network_data(), turn_info::send_data(), play_controller::skip_replay_, mp_campaign_info::skip_replay_until_turn, and playsingle_controller::turn_data_.
|
protectedvirtual |
Reimplemented from playsingle_controller.
Definition at line 82 of file playmp_controller.cpp.
References play_controller::current_team(), playsingle_controller::play_side_impl(), and mp_ui_alerts::turn_changed().
|
private |
Definition at line 455 of file playmp_controller.cpp.
References do_replay(), playsingle_controller::end_turn_, playsingle_controller::END_TURN_SYNCED, play_controller::is_regular_game_end(), playsingle_controller::network_reader_, play_controller::player_type_changed_, turn_info::PROCESS_CONTINUE, turn_info::PROCESS_END_LEVEL, turn_info::PROCESS_END_LINGER, turn_info::PROCESS_END_TURN, replay::process_error(), turn_info::process_network_data(), turn_info::PROCESS_RESTART_TURN, playturn_network_adapter::read(), resources::recorder, turn_info::replay_to_process_data_result(), and playsingle_controller::turn_data_.
Referenced by play_human_turn(), play_idle_loop(), and play_network_turn().
|
virtual |
Asks the user whether to continue on an OOS error.
quit_game_exception | If the user wants to abort. |
Reimplemented from play_controller.
Definition at line 357 of file playmp_controller.cpp.
References _(), config::add_child(), play_controller::gui_, i, play_controller::ignore_replay_errors_, lg::info(), save(), savegame::savegame::save_game_interactive(), play_controller::saved_game_, send_to_wesnothd(), utils::split(), and gui::YES_NO.
|
virtual |
Implements syncmp_handler.
Definition at line 431 of file playmp_controller.cpp.
References play_controller::can_undo(), play_controller::current_team(), play_controller::player_type_changed_, turn_info::PROCESS_END_LINGER, turn_info::PROCESS_END_TURN, turn_info::PROCESS_RESTART_TURN, turn_info::sync_network(), playsingle_controller::turn_data_, and play_controller::undo_stack().
|
overridevirtual |
Reimplemented from play_controller.
Definition at line 492 of file playmp_controller.cpp.
References mp_info_, twesnothd_connection::receive_data(), and mp_campaign_info::wesnothd_connection.
Referenced by wait_for_upload().
|
protected |
Definition at line 93 of file playmp_controller.cpp.
References blindfold_, play_controller::gui_, LOG_NG, and blindfold::unblind().
Referenced by on_not_observer(), play_human_turn(), and play_idle_loop().
|
private |
Definition at line 225 of file playmp_controller.cpp.
References play_controller::gui_, and game_display::RUNNING.
Referenced by linger().
|
overridevirtual |
Reimplemented from play_controller.
Definition at line 486 of file playmp_controller.cpp.
References mp_info_, twesnothd_connection::send_data(), and mp_campaign_info::wesnothd_connection.
Referenced by process_oos().
|
virtual |
Implements syncmp_handler.
Definition at line 446 of file playmp_controller.cpp.
References play_controller::can_undo(), turn_info::send_data(), playsingle_controller::turn_data_, and play_controller::undo_stack().
|
private |
Definition at line 213 of file playmp_controller.cpp.
References play_controller::gui_, and is_host().
Referenced by linger().
|
protected |
Definition at line 72 of file playmp_controller.cpp.
References LOG_NG, and network_processing_stopped_.
|
protected |
Definition at line 77 of file playmp_controller.cpp.
References LOG_NG, and network_processing_stopped_.
|
protected |
Wait for the host to upload the next scenario.
Definition at line 276 of file playmp_controller.cpp.
References _(), playturn_network_adapter::get_source_from_config(), play_controller::gui_, is_host(), mp_info_, playsingle_controller::network_reader_, dialogs::network_receive_dialog(), turn_info::PROCESS_END_LINGER, turn_info::process_network_data_from_reader(), recieve_from_wesnothd(), turn_info::send_data(), playturn_network_adapter::set_source(), throw_quit_game_exception(), playsingle_controller::turn_data_, and mp_campaign_info::wesnothd_connection.
Referenced by maybe_linger().
|
protected |
Definition at line 68 of file playmp_controller.hpp.
Referenced by remove_blindfold().
|
private |
Definition at line 73 of file playmp_controller.hpp.
Referenced by handle_generic_event(), is_host(), is_networked_mp(), play_network_turn(), playmp_controller(), recieve_from_wesnothd(), send_to_wesnothd(), and wait_for_upload().
|
mutableprotected |
Definition at line 62 of file playmp_controller.hpp.
Referenced by play_network_turn(), start_network(), and stop_network().