#include <synced_user_choice.hpp>
Public Member Functions | |
void | pull () |
bool | finished () const |
bool | has_local_choice () const |
bool | waiting () const |
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 () const |
void | process () |
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, const 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 81 of file synced_user_choice.hpp.
|
private |
Definition at line 235 of file synced_user_choice.cpp.
References synced_context::block_undo(), current_side_, do_replay_handle(), resources::gameboard, game_board::get_team(), required_, search_in_replay(), t, game_board::teams(), and update_local_choice().
|
inlineprivate |
Definition at line 100 of file synced_user_choice.hpp.
void user_choice_manager::ask_local_choice | ( | ) |
Definition at line 353 of file synced_user_choice.cpp.
References current_side_, DBG_REPLAY, local_choice_, mp_sync::user_choice::query_user(), resources::recorder, res_, synced_context::send_user_choice(), tagname_, uch_, synced_context::undo_blocked(), update_local_choice(), replay::user_input(), and WRN_REPLAY.
Referenced by get_user_choice_internal().
|
inline |
Definition at line 104 of file synced_user_choice.hpp.
References required_, and res_.
Referenced by get_user_choice_internal(), gui2::dialogs::synched_choice_wait::handle_generic_event(), gui2::dialogs::synched_choice_wait::pre_show(), process(), search_in_replay(), and wait_ingame().
void user_choice_manager::fix_oos | ( | ) |
Definition at line 381 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 |
uch | the choice made |
sides | an array of team numbers (beginning with 1). the specified sides may not have an empty controller. |
Definition at line 420 of file synced_user_choice.cpp.
References ask_local_choice(), finished(), fix_oos(), resources::gamedata, has_local_choice(), game_data::is_before_screen(), res_, 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 106 of file synced_user_choice.hpp.
References local_choice_.
Referenced by get_user_choice_internal(), and search_in_replay().
|
virtual |
Inherited from events::pump_monitor.
Implements events::pump_monitor.
Definition at line 458 of file synced_user_choice.cpp.
References finished(), oos_, and pull().
void user_choice_manager::pull | ( | ) |
Definition at line 306 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 265 of file synced_user_choice.cpp.
References changed_event_, DBG_REPLAY, config::debug(), do_replay_handle(), finished(), replay::get_next_action(), config::has_child(), has_local_choice(), config::mandatory_child(), 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 316 of file synced_user_choice.cpp.
References changed_event_, resources::gameboard, local_choice_, events::generic_event::notify_observers(), required_, res_, VNGETTEXT, and wait_message_.
Referenced by ask_local_choice(), pull(), and user_choice_manager().
|
inline |
Definition at line 114 of file synced_user_choice.hpp.
References wait_message_.
Referenced by gui2::dialogs::synched_choice_wait::handle_generic_event(), gui2::dialogs::synched_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 109 of file synced_user_choice.hpp.
References local_choice_, and oos_.
Referenced by get_user_choice_internal(), gui2::dialogs::synched_choice_wait::handle_generic_event(), gui2::dialogs::synched_choice_wait::pre_show(), and wait_ingame().
events::generic_event user_choice_manager::changed_event_ |
Definition at line 123 of file synced_user_choice.hpp.
Referenced by search_in_replay(), update_local_choice(), and gui2::dialogs::synched_choice_wait::~synched_choice_wait().
|
private |
Definition at line 97 of file synced_user_choice.hpp.
Referenced by ask_local_choice(), and user_choice_manager().
|
private |
Definition at line 89 of file synced_user_choice.hpp.
Referenced by ask_local_choice(), has_local_choice(), update_local_choice(), and waiting().
|
private |
Definition at line 93 of file synced_user_choice.hpp.
Referenced by fix_oos(), process(), search_in_replay(), and waiting().
|
private |
Definition at line 84 of file synced_user_choice.hpp.
Referenced by finished(), fix_oos(), search_in_replay(), update_local_choice(), and user_choice_manager().
|
private |
Definition at line 86 of file synced_user_choice.hpp.
Referenced by ask_local_choice(), finished(), fix_oos(), get_user_choice_internal(), search_in_replay(), and update_local_choice().
|
private |
Definition at line 96 of file synced_user_choice.hpp.
Referenced by ask_local_choice(), fix_oos(), and search_in_replay().
|
private |
Definition at line 95 of file synced_user_choice.hpp.
Referenced by ask_local_choice(), and fix_oos().
|
private |
Definition at line 91 of file synced_user_choice.hpp.
Referenced by update_local_choice(), and wait_message().