The Battle for Wesnoth  1.19.5+dev
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:

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, 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, 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, configres_
 
int local_choice_
 
std::string wait_message_
 
bool oos_
 
const mp_sync::user_choiceuch_
 
const std::string & tagname_
 
const int current_side_
 

Detailed Description

Definition at line 81 of file synced_user_choice.hpp.

Constructor & Destructor Documentation

◆ user_choice_manager()

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

◆ ~user_choice_manager()

user_choice_manager::~user_choice_manager ( )
inlineprivate

Definition at line 100 of file synced_user_choice.hpp.

Member Function Documentation

◆ ask_local_choice()

void user_choice_manager::ask_local_choice ( )

◆ finished()

bool user_choice_manager::finished ( ) const
inline

◆ fix_oos()

void user_choice_manager::fix_oos ( )

◆ get_user_choice_internal()

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
uchthe choice made
sidesan 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().

◆ has_local_choice()

bool user_choice_manager::has_local_choice ( ) const
inline

Definition at line 106 of file synced_user_choice.hpp.

References local_choice_.

Referenced by get_user_choice_internal(), and search_in_replay().

◆ process()

void user_choice_manager::process ( )
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().

◆ pull()

void user_choice_manager::pull ( )

◆ search_in_replay()

void user_choice_manager::search_in_replay ( )
private

◆ update_local_choice()

void user_choice_manager::update_local_choice ( )

◆ wait_message()

const std::string& user_choice_manager::wait_message ( ) const
inline

◆ waiting()

bool user_choice_manager::waiting ( ) const
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().

Member Data Documentation

◆ changed_event_

events::generic_event user_choice_manager::changed_event_

◆ current_side_

const int user_choice_manager::current_side_
private

Definition at line 97 of file synced_user_choice.hpp.

Referenced by ask_local_choice(), and user_choice_manager().

◆ local_choice_

int user_choice_manager::local_choice_
private

◆ oos_

bool user_choice_manager::oos_
private

Definition at line 93 of file synced_user_choice.hpp.

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

◆ required_

std::set<int> user_choice_manager::required_
private

◆ res_

std::map<int, config> user_choice_manager::res_
private

◆ tagname_

const std::string& user_choice_manager::tagname_
private

Definition at line 96 of file synced_user_choice.hpp.

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

◆ uch_

const mp_sync::user_choice& user_choice_manager::uch_
private

Definition at line 95 of file synced_user_choice.hpp.

Referenced by ask_local_choice(), and fix_oos().

◆ wait_message_

std::string user_choice_manager::wait_message_
private

Definition at line 91 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: