TODO: rename this class since it isn't that much related to turns. More...
#include <playturn.hpp>
Public Types | |
enum | PROCESS_DATA_RESULT { PROCESS_CONTINUE, PROCESS_RESTART_TURN, PROCESS_END_TURN, PROCESS_END_LINGER, PROCESS_FOUND_DEPENDENT, PROCESS_END_LEVEL } |
Public Member Functions | |
turn_info (replay_network_sender &network_sender, playturn_network_adapter &network_reader) | |
~turn_info () | |
PROCESS_DATA_RESULT | sync_network () |
void | send_data () |
PROCESS_DATA_RESULT | process_network_data (const config &cfg) |
PROCESS_DATA_RESULT | process_network_data_from_reader () |
events::generic_event & | host_transfer () |
Static Public Member Functions | |
static PROCESS_DATA_RESULT | replay_to_process_data_result (REPLAY_RETURN replayreturn) |
Private Member Functions | |
PROCESS_DATA_RESULT | handle_turn (const config &t) |
void | do_save () |
Static Private Member Functions | |
static void | change_side_controller (int side, const std::string &player) |
Private Attributes | |
replay_network_sender & | replay_sender_ |
events::generic_event | host_transfer_ |
playturn_network_adapter & | network_reader_ |
TODO: rename this class since it isn't that much related to turns.
Definition at line 28 of file playturn.hpp.
Definition at line 37 of file playturn.hpp.
turn_info::turn_info | ( | replay_network_sender & | network_sender, |
playturn_network_adapter & | network_reader | ||
) |
Definition at line 53 of file playturn.cpp.
turn_info::~turn_info | ( | ) |
Definition at line 60 of file playturn.cpp.
|
staticprivate |
Definition at line 373 of file playturn.cpp.
References config::add_child(), resources::controller, and play_controller::send_to_wesnothd().
Referenced by process_network_data().
|
private |
Definition at line 104 of file playturn.cpp.
References resources::controller, and play_controller::do_autosave().
Referenced by process_network_data().
|
private |
Definition at line 92 of file playturn.cpp.
References replay::add_config(), config::all_children_count(), do_replay(), replay::MARK_AS_SENT, resources::recorder, and replay_to_process_data_result().
Referenced by process_network_data().
|
inline |
Definition at line 60 of file playturn.hpp.
References host_transfer_.
Referenced by playmp_controller::playmp_controller(), and playmp_controller::~playmp_controller().
turn_info::PROCESS_DATA_RESULT turn_info::process_network_data | ( | const config & | cfg | ) |
Definition at line 126 of file playturn.cpp.
References _(), display_chat_manager::add_chat_message(), display_chat_manager::add_observer(), config::all_children_count(), config::attribute_range(), change_side_controller(), config::child(), resources::controller, team::current_player(), config::debug(), do_save(), ERR_NW, display::find_action_button(), resources::gameboard, resources::gamedata, game_display::get_chat_manager(), handle_turn(), config::has_child(), host_transfer_, team::is_local(), team::is_local_human(), display::labels(), preferences::message_bell(), events::chat_handler::MESSAGE_PRIVATE, events::chat_handler::MESSAGE_PUBLIC, game_logic::msg(), game_data::next_scenario(), events::generic_event::notify_observers(), play_controller::on_not_observer(), preferences::options(), game_display::playing_side(), PROCESS_CONTINUE, PROCESS_END_LINGER, PROCESS_RESTART_TURN, map_labels::recalculate_labels(), display::recalculate_minimap(), resources::recorder, display::redraw_everything(), display_chat_manager::remove_observer(), resources::screen, gui2::tsimple_item_selector::selected_index(), gui2::tsimple_item_selector::set_single_button(), display::set_team(), gui2::tdialog::show(), game_board::side_change_controller(), game_board::side_drop_to(), resources::teams, teams, game_board::teams(), throw_quit_game_exception(), vgettext(), and resources::whiteboard.
Referenced by playmp_controller::play_linger_turn(), playmp_controller::process_network_data(), process_network_data_from_reader(), and sync_network().
turn_info::PROCESS_DATA_RESULT turn_info::process_network_data_from_reader | ( | ) |
Definition at line 111 of file playturn.cpp.
References config::clear(), network_reader_, PROCESS_CONTINUE, process_network_data(), and playturn_network_adapter::read().
Referenced by playmp_controller::wait_for_upload().
|
static |
Definition at line 382 of file playturn.cpp.
References PROCESS_CONTINUE, PROCESS_END_LEVEL, PROCESS_END_TURN, PROCESS_FOUND_DEPENDENT, REPLAY_FOUND_DEPENDENT, REPLAY_FOUND_END_LEVEL, REPLAY_FOUND_END_TURN, and REPLAY_RETURN_AT_END.
Referenced by handle_turn(), playmp_controller::process_network_data(), and sync_network().
void turn_info::send_data | ( | ) |
Definition at line 83 of file playturn.cpp.
References replay_network_sender::commit_and_sync(), replay_sender_, replay_network_sender::sync_non_undoable(), and resources::undo_stack.
Referenced by playmp_controller::after_human_turn(), playmp_controller::handle_generic_event(), playmp_controller::linger(), playsingle_controller::play_ai_turn(), playmp_controller::play_human_turn(), playmp_controller::play_idle_loop(), playmp_controller::play_network_turn(), playsingle_controller::play_scenario_main_loop(), playmp_controller::send_user_choice(), sync_network(), and playmp_controller::wait_for_upload().
turn_info::PROCESS_DATA_RESULT turn_info::sync_network | ( | ) |
Definition at line 64 of file playturn.cpp.
References config::clear(), resources::controller, do_replay(), network_reader_, PROCESS_CONTINUE, process_network_data(), playturn_network_adapter::read(), replay_to_process_data_result(), and send_data().
Referenced by playsingle_controller::play_ai_turn(), and playmp_controller::pull_remote_choice().
|
private |
Definition at line 71 of file playturn.hpp.
Referenced by host_transfer(), and process_network_data().
|
private |
Definition at line 73 of file playturn.hpp.
Referenced by process_network_data_from_reader(), and sync_network().
|
private |
Definition at line 69 of file playturn.hpp.
Referenced by send_data().