The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
user_choice_manager Class Reference

#include <synced_user_choice.hpp>

Inheritance diagram for user_choice_manager:
Inheritance graph

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::stringwait_message ()
 
void process (events::pump_info &)
 Inherited from events::pump_monitor. More...
 

Static Public Member Functions

static std::map< int, configget_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< intrequired_
 
std::map< int, configres_
 
int local_choice_
 
std::string wait_message_
 
bool oos_
 
const mp_sync::user_choiceuch_
 
const std::stringtagname_
 
const int current_side_
 

Detailed Description

Definition at line 75 of file synced_user_choice.hpp.

Constructor & Destructor Documentation

user_choice_manager::user_choice_manager ( const std::string name,
const mp_sync::user_choice uch,
std::set< int sides 
)
private
user_choice_manager::~user_choice_manager ( )
inlineprivate

Definition at line 94 of file synced_user_choice.hpp.

Member Function Documentation

void user_choice_manager::ask_local_choice ( )
bool user_choice_manager::finished ( )
inline
void user_choice_manager::fix_oos ( )
std::map< int, config > user_choice_manager::get_user_choice_internal ( const std::string name,
const mp_sync::user_choice uch,
const std::set< int > &  sides 
)
static
Parameters
namethe tagname for this user choice in the replay
sidesan 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().

bool user_choice_manager::has_local_choice ( )
inline

Definition at line 100 of file synced_user_choice.hpp.

Referenced by get_user_choice_internal(), and search_in_replay().

void user_choice_manager::process ( events::pump_info )
virtual

Inherited from events::pump_monitor.

Implements events::pump_monitor.

Definition at line 429 of file synced_user_choice.cpp.

References pull(), and waiting().

void user_choice_manager::pull ( )
void user_choice_manager::search_in_replay ( )
private
void user_choice_manager::update_local_choice ( )
const std::string& user_choice_manager::wait_message ( )
inline
bool user_choice_manager::waiting ( )
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().

Member Data Documentation

events::generic_event user_choice_manager::changed_event_
const int user_choice_manager::current_side_
private

Definition at line 91 of file synced_user_choice.hpp.

Referenced by ask_local_choice(), and user_choice_manager().

int user_choice_manager::local_choice_
private

Definition at line 83 of file synced_user_choice.hpp.

Referenced by ask_local_choice(), and update_local_choice().

bool user_choice_manager::oos_
private

Definition at line 87 of file synced_user_choice.hpp.

Referenced by fix_oos(), search_in_replay(), and waiting().

std::set<int> user_choice_manager::required_
private
std::map<int, config> user_choice_manager::res_
private
const std::string& user_choice_manager::tagname_
private

Definition at line 90 of file synced_user_choice.hpp.

Referenced by ask_local_choice(), fix_oos(), and search_in_replay().

const mp_sync::user_choice& user_choice_manager::uch_
private

Definition at line 89 of file synced_user_choice.hpp.

Referenced by ask_local_choice(), fix_oos(), and update_local_choice().

std::string user_choice_manager::wait_message_
private

Definition at line 85 of file synced_user_choice.hpp.

Referenced by update_local_choice(), and wait_message().


The documentation for this class was generated from the following files: