The Battle for Wesnoth  1.19.4+dev
Classes | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
ng::connect_engine Class Reference

#include <connect_engine.hpp>

Inheritance diagram for ng::connect_engine:

Classes

struct  team_data_pod
 

Public Member Functions

 connect_engine (saved_game &state, const bool first_scenario, mp_game_metadata *metadata)
 
configcurrent_config ()
 
void import_user (const std::string &name, const bool observer, int side_taken=-1)
 
void import_user (const config &data, const bool observer, int side_taken=-1)
 
bool sides_available () const
 
void update_level ()
 
void update_and_send_diff ()
 
bool can_start_game () const
 
void start_game ()
 
void start_game_commandline (const commandline_options &cmdline_opts, const game_config_view &game_config)
 
void leave_game ()
 
std::pair< bool, bool > process_network_data (const config &data)
 
int find_user_side_index_by_id (const std::string &id) const
 
const configlevel () const
 
configscenario ()
 
const std::set< std::string > & connected_users () const
 
const std::vector< team_data_pod > & team_data () const
 
std::vector< side_engine_ptr > & side_engines ()
 
const mp_game_settingsparams () const
 
bool first_scenario () const
 
bool force_lock_settings () const
 

Private Member Functions

 connect_engine (const connect_engine &)=delete
 
connect_engineoperator= (const connect_engine &)=delete
 
void send_level_data () const
 
void save_reserved_sides_information ()
 
void load_previous_sides_users ()
 
void update_side_controller_options ()
 
std::set< std::string > & connected_users_rw ()
 

Private Attributes

config level_
 
saved_gamestate_
 
const mp_game_settingsparams_
 
const ng::controller default_controller_
 
mp_game_metadatamp_metadata_
 
const bool first_scenario_
 
bool force_lock_settings_
 
std::vector< side_engine_ptrside_engines_
 
std::vector< const config * > era_factions_
 
std::vector< team_data_podteam_data_
 

Friends

class side_engine
 

Detailed Description

Definition at line 43 of file connect_engine.hpp.

Constructor & Destructor Documentation

◆ connect_engine() [1/2]

ng::connect_engine::connect_engine ( saved_game state,
const bool  first_scenario,
mp_game_metadata metadata 
)

◆ connect_engine() [2/2]

ng::connect_engine::connect_engine ( const connect_engine )
privatedelete

Member Function Documentation

◆ can_start_game()

bool ng::connect_engine::can_start_game ( ) const

◆ connected_users()

const std::set< std::string > & ng::connect_engine::connected_users ( ) const

Definition at line 805 of file connect_engine.cpp.

Referenced by ng::side_engine::update_controller_options().

◆ connected_users_rw()

std::set< std::string > & ng::connect_engine::connected_users_rw ( )
private

Definition at line 815 of file connect_engine.cpp.

◆ current_config()

config * ng::connect_engine::current_config ( )

Definition at line 223 of file connect_engine.cpp.

Referenced by connect_engine(), and create_side_engine().

◆ find_user_side_index_by_id()

int ng::connect_engine::find_user_side_index_by_id ( const std::string &  id) const

Definition at line 717 of file connect_engine.cpp.

References i.

◆ first_scenario()

bool ng::connect_engine::first_scenario ( ) const
inline

Definition at line 108 of file connect_engine.hpp.

References first_scenario_.

◆ force_lock_settings()

bool ng::connect_engine::force_lock_settings ( ) const
inline

Definition at line 109 of file connect_engine.hpp.

References force_lock_settings_.

Referenced by gui2::dialogs::mp_staging::add_side_node().

◆ import_user() [1/2]

void ng::connect_engine::import_user ( const config data,
const bool  observer,
int  side_taken = -1 
)

◆ import_user() [2/2]

void ng::connect_engine::import_user ( const std::string &  name,
const bool  observer,
int  side_taken = -1 
)

Definition at line 227 of file connect_engine.cpp.

References game_config::images::observer, and user_data.

◆ leave_game()

void ng::connect_engine::leave_game ( )

Definition at line 562 of file connect_engine.cpp.

References DBG_MP, and mp::send_to_server().

Referenced by gui2::dialogs::mp_staging::post_show().

◆ level()

const config& ng::connect_engine::level ( ) const
inline

Definition at line 81 of file connect_engine.hpp.

References level_.

◆ load_previous_sides_users()

void ng::connect_engine::load_previous_sides_users ( )
private

Definition at line 771 of file connect_engine.cpp.

References ng::CNTR_COMPUTER, ng::CNTR_RESERVED, utils::map_split(), and names.

◆ operator=()

connect_engine& ng::connect_engine::operator= ( const connect_engine )
privatedelete

◆ params()

const mp_game_settings& ng::connect_engine::params ( ) const
inline

◆ process_network_data()

std::pair< bool, bool > ng::connect_engine::process_network_data ( const config data)

◆ save_reserved_sides_information()

void ng::connect_engine::save_reserved_sides_information ( )
private

Definition at line 755 of file connect_engine.cpp.

References utils::join_map(), and utils::map_split().

◆ scenario()

config& ng::connect_engine::scenario ( )
inline

Definition at line 82 of file connect_engine.hpp.

References level_, and config::optional_child().

Referenced by connect_engine(), and gui2::dialogs::mp_staging::pre_show().

◆ send_level_data()

void ng::connect_engine::send_level_data ( ) const
private

◆ side_engines()

std::vector<side_engine_ptr>& ng::connect_engine::side_engines ( )
inline

◆ sides_available()

bool ng::connect_engine::sides_available ( ) const

◆ start_game()

void ng::connect_engine::start_game ( )

◆ start_game_commandline()

void ng::connect_engine::start_game_commandline ( const commandline_options cmdline_opts,
const game_config_view game_config 
)

◆ team_data()

const std::vector<team_data_pod>& ng::connect_engine::team_data ( ) const
inline

Definition at line 101 of file connect_engine.hpp.

References team_data_.

Referenced by gui2::dialogs::mp_staging::add_side_node().

◆ update_and_send_diff()

void ng::connect_engine::update_and_send_diff ( )

◆ update_level()

void ng::connect_engine::update_level ( )

Definition at line 301 of file connect_engine.cpp.

References DBG_MP.

◆ update_side_controller_options()

void ng::connect_engine::update_side_controller_options ( )
private

Definition at line 798 of file connect_engine.cpp.

Friends And Related Function Documentation

◆ side_engine

friend class side_engine
friend

Definition at line 122 of file connect_engine.hpp.

Member Data Documentation

◆ default_controller_

const ng::controller ng::connect_engine::default_controller_
private

◆ era_factions_

std::vector<const config*> ng::connect_engine::era_factions_
private

Definition at line 136 of file connect_engine.hpp.

Referenced by connect_engine().

◆ first_scenario_

const bool ng::connect_engine::first_scenario_
private

Definition at line 131 of file connect_engine.hpp.

Referenced by first_scenario().

◆ force_lock_settings_

bool ng::connect_engine::force_lock_settings_
private

Definition at line 133 of file connect_engine.hpp.

Referenced by connect_engine(), and force_lock_settings().

◆ level_

config ng::connect_engine::level_
private

Definition at line 124 of file connect_engine.hpp.

Referenced by connect_engine(), level(), and scenario().

◆ mp_metadata_

mp_game_metadata* ng::connect_engine::mp_metadata_
private

Definition at line 130 of file connect_engine.hpp.

Referenced by ng::side_engine::update_controller_options().

◆ params_

const mp_game_settings& ng::connect_engine::params_
private

◆ side_engines_

std::vector<side_engine_ptr> ng::connect_engine::side_engines_
private

Definition at line 135 of file connect_engine.hpp.

Referenced by side_engines().

◆ state_

saved_game& ng::connect_engine::state_
private

Definition at line 125 of file connect_engine.hpp.

Referenced by connect_engine(), and ng::side_engine::side_engine().

◆ team_data_

std::vector<team_data_pod> ng::connect_engine::team_data_
private

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