#include <synced_user_choice.hpp>
Public Member Functions | |
void | pull () |
bool | finished () |
bool | has_local_choice () |
bool | waiting () |
Note: currently finished() does not imply !waiting() so you may need to check both. More... | |
void | update_local_choice () |
void | ask_local_choice () |
void | fix_oos () |
const std::string & | wait_message () |
void | process (events::pump_info &) |
Inherited from events::pump_monitor. More... | |
Static Public Member Functions | |
static std::map< int, config > | get_user_choice_internal (const std::string &name, const mp_sync::user_choice &uch, const std::set< int > &sides) |
Public Attributes | |
events::generic_event | changed_event_ |
Private Member Functions | |
user_choice_manager (const std::string &name, const mp_sync::user_choice &uch, std::set< int > sides) | |
~user_choice_manager () | |
void | search_in_replay () |
Private Member Functions inherited from events::pump_monitor | |
pump_monitor () | |
virtual | ~pump_monitor () |
Private Attributes | |
std::set< int > | required_ |
std::map< int, config > | res_ |
int | local_choice_ |
std::string | wait_message_ |
bool | oos_ |
const mp_sync::user_choice & | uch_ |
const std::string & | tagname_ |
const int | current_side_ |
Definition at line 75 of file synced_user_choice.hpp.
|
private |
Definition at line 225 of file synced_user_choice.cpp.
References current_side_, do_replay_handle(), team::is_empty(), required_, search_in_replay(), synced_context::set_is_simultaneously(), resources::teams, and update_local_choice().
|
inlineprivate |
Definition at line 94 of file synced_user_choice.hpp.
void user_choice_manager::ask_local_choice | ( | ) |
Definition at line 335 of file synced_user_choice.cpp.
References current_side_, DBG_REPLAY, synced_context::is_simultaneously(), local_choice_, mp_sync::user_choice::query_user(), resources::recorder, res_, synced_context::send_user_choice(), tagname_, uch_, update_local_choice(), replay::user_input(), and WRN_REPLAY.
Referenced by get_user_choice_internal().
|
inline |
Definition at line 98 of file synced_user_choice.hpp.
Referenced by get_user_choice_internal(), gui2::tsynced_choice_wait::handle_generic_event(), gui2::tsynced_choice_wait::pre_show(), search_in_replay(), and wait_ingame().
void user_choice_manager::fix_oos | ( | ) |
Definition at line 363 of file synced_user_choice.cpp.
References mp_sync::user_choice::description(), ERR_REPLAY, oos_, mp_sync::user_choice::query_user(), required_, res_, tagname_, and uch_.
Referenced by get_user_choice_internal().
|
static |
name | the tagname for this user choice in the replay |
sides | an array of team numbers (beginning with 1). the specified sides may not have an empty controller. |
Definition at line 402 of file synced_user_choice.cpp.
References ask_local_choice(), finished(), fix_oos(), resources::gamedata, has_local_choice(), game_data::phase(), game_data::PLAY, res_, game_data::START, wait_ingame(), wait_prestart(), and waiting().
Referenced by mp_sync::get_user_choice(), and mp_sync::get_user_choice_multiple_sides().
|
inline |
Definition at line 100 of file synced_user_choice.hpp.
Referenced by get_user_choice_internal(), and search_in_replay().
|
virtual |
Inherited from events::pump_monitor.
Implements events::pump_monitor.
Definition at line 429 of file synced_user_choice.cpp.
void user_choice_manager::pull | ( | ) |
Definition at line 296 of file synced_user_choice.cpp.
References do_replay_handle(), synced_context::pull_remote_user_input(), search_in_replay(), and update_local_choice().
Referenced by process().
|
private |
Definition at line 255 of file synced_user_choice.cpp.
References changed_event_, config::child(), DBG_REPLAY, config::debug(), do_replay_handle(), finished(), replay::get_next_action(), config::has_child(), has_local_choice(), events::generic_event::notify_observers(), oos_, replay::process_error(), resources::recorder, required_, res_, replay::revert_action(), and tagname_.
Referenced by pull(), and user_choice_manager().
void user_choice_manager::update_local_choice | ( | ) |
Definition at line 306 of file synced_user_choice.cpp.
References changed_event_, mp_sync::user_choice::description(), local_choice_, events::generic_event::notify_observers(), required_, res_, string_map_of(), resources::teams, uch_, vgettext(), and wait_message_.
Referenced by ask_local_choice(), pull(), and user_choice_manager().
|
inline |
Definition at line 108 of file synced_user_choice.hpp.
References wait_message_.
Referenced by gui2::tsynced_choice_wait::handle_generic_event(), gui2::tsynced_choice_wait::pre_show(), and wait_ingame().
|
inline |
Note: currently finished() does not imply !waiting() so you may need to check both.
Definition at line 103 of file synced_user_choice.hpp.
References oos_.
Referenced by get_user_choice_internal(), gui2::tsynced_choice_wait::handle_generic_event(), gui2::tsynced_choice_wait::pre_show(), process(), and wait_ingame().
events::generic_event user_choice_manager::changed_event_ |
Definition at line 114 of file synced_user_choice.hpp.
Referenced by search_in_replay(), update_local_choice(), and gui2::tsynced_choice_wait::~tsynced_choice_wait().
|
private |
Definition at line 91 of file synced_user_choice.hpp.
Referenced by ask_local_choice(), and user_choice_manager().
|
private |
Definition at line 83 of file synced_user_choice.hpp.
Referenced by ask_local_choice(), and update_local_choice().
|
private |
Definition at line 87 of file synced_user_choice.hpp.
Referenced by fix_oos(), search_in_replay(), and waiting().
|
private |
Definition at line 78 of file synced_user_choice.hpp.
Referenced by fix_oos(), search_in_replay(), update_local_choice(), and user_choice_manager().
Definition at line 80 of file synced_user_choice.hpp.
Referenced by ask_local_choice(), fix_oos(), get_user_choice_internal(), search_in_replay(), and update_local_choice().
|
private |
Definition at line 90 of file synced_user_choice.hpp.
Referenced by ask_local_choice(), fix_oos(), and search_in_replay().
|
private |
Definition at line 89 of file synced_user_choice.hpp.
Referenced by ask_local_choice(), fix_oos(), and update_local_choice().
|
private |
Definition at line 85 of file synced_user_choice.hpp.
Referenced by update_local_choice(), and wait_message().