#include <playmp_controller.hpp>
Public Member Functions | |
playmp_controller (const config &level, game_state &state_of_game, const int ticks, const int num_turns, const config &game_config, CVideo &video, bool skip_replay, bool is_host) | |
~playmp_controller () | |
bool | is_host () |
bool | counting_down () |
void | think_about_countdown (int ticks) |
void | process (events::pump_info &info) |
void | linger (upload_log &log) |
void | wait_for_upload () |
Wait for the host to upload the next scenario. | |
Static Public Member Functions | |
static unsigned int | replay_last_turn () |
static void | set_replay_last_turn (unsigned int turn) |
Protected Member Functions | |
virtual void | handle_generic_event (const std::string &name) |
virtual void | speak () |
virtual void | whisper () |
virtual void | shout () |
virtual void | clear_labels () |
virtual bool | can_execute_command (hotkey::HOTKEY_COMMAND command, int index=-1) const |
Check if a command can be executed. | |
virtual void | play_side (const unsigned int team_index, bool save) |
virtual void | before_human_turn (bool save) |
virtual void | play_human_turn () |
virtual void | after_human_turn () |
virtual void | finish_side_turn () |
void | play_network_turn () |
Protected Attributes | |
turn_info * | turn_data_ |
int | beep_warning_time_ |
Private Member Functions | |
void | process_oos (const std::string &err_msg) |
void | set_end_scenario_button () |
void | reset_end_scenario_button () |
Static Private Attributes | |
static unsigned int | replay_last_turn_ = 0 |
Definition at line 28 of file playmp_controller.hpp.
playmp_controller::playmp_controller | ( | const config & | level, | |
game_state & | state_of_game, | |||
const int | ticks, | |||
const int | num_turns, | |||
const config & | game_config, | |||
CVideo & | video, | |||
bool | skip_replay, | |||
bool | is_host | |||
) |
Definition at line 32 of file playmp_controller.cpp.
References beep_warning_time_, play_controller::is_host_, replay_last_turn_, play_controller::skip_replay_, and turn_data_.
playmp_controller::~playmp_controller | ( | ) |
Definition at line 49 of file playmp_controller.cpp.
References beep_warning_time_, and sound::stop_bell().
bool playmp_controller::is_host | ( | ) | [inline] |
static unsigned int playmp_controller::replay_last_turn | ( | ) | [inline, static] |
void playmp_controller::set_replay_last_turn | ( | unsigned int | turn | ) | [static] |
Definition at line 56 of file playmp_controller.cpp.
References replay_last_turn_.
Referenced by mp::lobby::process_event(), mp::start_client(), and mp::start_server().
bool playmp_controller::counting_down | ( | ) |
Definition at line 132 of file playmp_controller.cpp.
References beep_warning_time_.
Referenced by play_human_turn(), and process().
void playmp_controller::think_about_countdown | ( | int | ticks | ) |
Definition at line 152 of file playmp_controller.cpp.
References beep_warning_time_, sound::play_timer(), preferences::sound_on(), game_config::sounds::timer_bell, preferences::turn_bell(), preferences::UI_sound_on(), and WARNTIME.
Referenced by play_human_turn(), and process().
void playmp_controller::process | ( | events::pump_info & | info | ) | [virtual] |
Implements events::pump_monitor.
Definition at line 143 of file playmp_controller.cpp.
References counting_down(), think_about_countdown(), events::pump_info::ticks(), timer_refresh, and timer_refresh_rate.
void playmp_controller::linger | ( | upload_log & | log | ) |
Reimplemented from playsingle_controller.
Definition at line 262 of file playmp_controller.cpp.
References after_human_turn(), events::generic_event::attach_handler(), beep_warning_time_, unit_map::begin(), play_controller::browse_, game_state::completion, game_display::draw(), unit_map::end(), play_controller::first_player_, play_controller::gamestate_, play_controller::gui_, turn_info::host_transfer(), display::invalidate_all(), play_controller::linger_, game_display::LINGER_MP, LOG_NG, play_controller::map_, play_human_turn(), play_controller::player_number_, upload_log::quit(), display::recalculate_minimap(), turn_info::replay_error(), playsingle_controller::replay_sender_, reset_end_scenario_button(), set_end_scenario_button(), game_display::set_game_mode(), game_display::set_team(), play_controller::status_, sound::stop_bell(), play_controller::teams_, gamestatus::turn(), turn_data_, play_controller::undo_stack_, and play_controller::units_.
void playmp_controller::wait_for_upload | ( | ) |
Wait for the host to upload the next scenario.
Definition at line 337 of file playmp_controller.cpp.
References _, events::generic_event::attach_handler(), cfg, play_controller::gamestate_, play_controller::gui_, turn_info::host_transfer(), play_controller::is_host_, play_controller::map_, replay::error::message, dialogs::network_receive_dialog(), network::null_connection, play_controller::player_number_, turn_info::PROCESS_END_LINGER, turn_info::process_network_data(), process_oos(), turn_info::replay_error(), playsingle_controller::replay_sender_, turn_info::send_data(), play_controller::skip_replay_, play_controller::status_, play_controller::teams_, turn_data_, play_controller::undo_stack_, and play_controller::units_.
void playmp_controller::handle_generic_event | ( | const std::string & | name | ) | [protected, virtual] |
Reimplemented from playsingle_controller.
Definition at line 493 of file playmp_controller.cpp.
References gui::button::enable(), display::find_button(), play_controller::gamestate_, play_controller::gui_, playsingle_controller::handle_generic_event(), display::invalidate_theme(), play_controller::is_host_, replay::last_replay_error, play_controller::linger_, play_controller::map_, play_controller::player_number_, process_oos(), playsingle_controller::replay_sender_, turn_info::send_data(), play_controller::status_, turn_info::sync_network(), play_controller::teams_, play_controller::undo_stack_, and play_controller::units_.
void playmp_controller::speak | ( | ) | [protected, virtual] |
Reimplemented from hotkey::command_executor.
Definition at line 64 of file playmp_controller.cpp.
References play_controller::menu_handler_, and events::menu_handler::speak().
void playmp_controller::whisper | ( | ) | [protected, virtual] |
Reimplemented from hotkey::command_executor.
Definition at line 68 of file playmp_controller.cpp.
References play_controller::menu_handler_, and events::menu_handler::whisper().
void playmp_controller::shout | ( | ) | [protected, virtual] |
Reimplemented from hotkey::command_executor.
Definition at line 72 of file playmp_controller.cpp.
References play_controller::menu_handler_, and events::menu_handler::shout().
void playmp_controller::clear_labels | ( | ) | [protected, virtual] |
Reimplemented from hotkey::command_executor.
Definition at line 60 of file playmp_controller.cpp.
References events::menu_handler::clear_labels(), and play_controller::menu_handler_.
bool playmp_controller::can_execute_command | ( | hotkey::HOTKEY_COMMAND | command, | |
int | index = -1 | |||
) | const [protected, virtual] |
Check if a command can be executed.
Reimplemented from playsingle_controller.
Definition at line 518 of file playmp_controller.cpp.
References playsingle_controller::can_execute_command(), hotkey::HOTKEY_CLEAR_LABELS, hotkey::HOTKEY_SPEAK, hotkey::HOTKEY_SPEAK_ALL, hotkey::HOTKEY_SPEAK_ALLY, is_observer(), and network::nconnections().
void playmp_controller::play_side | ( | const unsigned int | team_index, | |
bool | save | |||
) | [protected, virtual] |
Reimplemented from playsingle_controller.
Definition at line 76 of file playmp_controller.cpp.
References after_human_turn(), beep_warning_time_, before_human_turn(), play_controller::current_team(), game_display::draw(), playsingle_controller::end_turn(), playsingle_controller::end_turn_, play_controller::find_human_team_before(), game_display::get_playing_team(), play_controller::gui_, display::invalidate_all(), LOG_NG, playsingle_controller::play_ai_turn(), play_human_turn(), play_network_turn(), play_controller::player_number_, playsingle_controller::player_type_changed_, display::recalculate_minimap(), end_turn_exception::redo, statistics::reset_turn_stats(), game_display::set_team(), and play_controller::teams_.
void playmp_controller::before_human_turn | ( | bool | save | ) | [protected, virtual] |
Reimplemented from playsingle_controller.
Definition at line 123 of file playmp_controller.cpp.
References events::generic_event::attach_handler(), playsingle_controller::before_human_turn(), play_controller::gamestate_, play_controller::gui_, turn_info::host_transfer(), play_controller::map_, play_controller::player_number_, turn_info::replay_error(), playsingle_controller::replay_sender_, play_controller::status_, play_controller::teams_, turn_data_, play_controller::undo_stack_, and play_controller::units_.
Referenced by play_side().
void playmp_controller::play_human_turn | ( | ) | [protected, virtual] |
Reimplemented from playsingle_controller.
Definition at line 164 of file playmp_controller.cpp.
References team::action_bonus_count(), replay::add_countdown_update(), beep_warning_time_, cfg, events::menu_handler::clear_undo_stack(), team::countdown_time(), counting_down(), play_controller::current_team(), game_display::draw(), display::enable_menu(), replay::end_turn(), playsingle_controller::end_turn_, game_display::get_playing_team(), play_controller::gui_, play_controller::is_host_, play_controller::level_, play_controller::linger_, play_controller::menu_handler_, replay::error::message, network::null_connection, play_controller::play_slice(), play_controller::player_number_, turn_info::process_network_data(), process_oos(), turn_info::PROCESS_RESTART_TURN, network::receive_data(), recorder, turn_info::send_data(), team::set_action_bonus_count(), team::set_countdown_time(), play_controller::skip_replay_, think_about_countdown(), turn_data_, and WARNTIME.
Referenced by linger(), and play_side().
void playmp_controller::after_human_turn | ( | ) | [protected, virtual] |
Reimplemented from playsingle_controller.
Definition at line 383 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_team(), events::generic_event::detach_handler(), playsingle_controller::end_turn_record(), turn_info::host_transfer(), play_controller::level_, play_controller::player_number_, recorder, turn_info::replay_error(), turn_info::send_data(), team::set_action_bonus_count(), team::set_countdown_time(), and turn_data_.
Referenced by linger(), and play_side().
void playmp_controller::finish_side_turn | ( | ) | [protected, virtual] |
Reimplemented from play_controller.
Definition at line 408 of file playmp_controller.cpp.
References beep_warning_time_, play_controller::finish_side_turn(), sound::stop_bell(), and turn_data_.
void playmp_controller::play_network_turn | ( | ) | [protected] |
Definition at line 421 of file playmp_controller.cpp.
References events::generic_event::attach_handler(), play_controller::browse_, cfg, playsingle_controller::data_backlog_, events::generic_event::detach_handler(), game_display::draw(), display::enable_menu(), from, play_controller::gamestate_, play_controller::gui_, turn_info::host_transfer(), LOG_NG, play_controller::map_, replay::error::message, network::null_connection, play_controller::play_slice(), play_controller::player_number_, playsingle_controller::player_type_changed_, turn_info::PROCESS_END_TURN, turn_info::process_network_data(), process_oos(), turn_info::PROCESS_RESTART_TURN, network::receive_data(), turn_info::replay_error(), replay_last_turn_, playsingle_controller::replay_sender_, turn_info::send_data(), play_controller::skip_replay_, play_controller::status_, play_controller::teams_, gamestatus::turn(), play_controller::undo_stack_, and play_controller::units_.
Referenced by play_side().
void playmp_controller::process_oos | ( | const std::string & | err_msg | ) | [private] |
Definition at line 478 of file playmp_controller.cpp.
References _, play_controller::menu_handler_, events::menu_handler::save_game(), utils::split(), and gui::YES_NO.
Referenced by handle_generic_event(), play_human_turn(), play_network_turn(), and wait_for_upload().
void playmp_controller::set_end_scenario_button | ( | ) | [private] |
Definition at line 241 of file playmp_controller.cpp.
References _, gui::button::enable(), display::find_button(), display::get_theme(), play_controller::gui_, display::invalidate_theme(), play_controller::is_host_, display::redraw_everything(), and theme::refresh_title().
Referenced by linger().
void playmp_controller::reset_end_scenario_button | ( | ) | [private] |
Definition at line 253 of file playmp_controller.cpp.
References display::get_theme(), play_controller::gui_, display::invalidate_theme(), display::redraw_everything(), theme::refresh_title2(), game_display::RUNNING, and game_display::set_game_mode().
Referenced by linger().
turn_info* playmp_controller::turn_data_ [protected] |
Definition at line 64 of file playmp_controller.hpp.
Referenced by after_human_turn(), before_human_turn(), finish_side_turn(), linger(), play_human_turn(), playmp_controller(), and wait_for_upload().
int playmp_controller::beep_warning_time_ [protected] |
Definition at line 66 of file playmp_controller.hpp.
Referenced by counting_down(), finish_side_turn(), linger(), play_human_turn(), play_side(), playmp_controller(), think_about_countdown(), and ~playmp_controller().
unsigned int playmp_controller::replay_last_turn_ = 0 [static, private] |
Definition at line 71 of file playmp_controller.hpp.
Referenced by play_network_turn(), playmp_controller(), replay_last_turn(), and set_replay_last_turn().
Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |