The Battle for Wesnoth  1.13.10+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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:
Inheritance graph

Public Member Functions

 connect_engine (saved_game &state, const bool first_scenario, mp_campaign_info *campaign_info)
 
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 update_time_of_day=false)
 
bool can_start_game () const
 
void start_game ()
 
void start_game_commandline (const commandline_options &cmdline_opts)
 
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< std::string > & user_team_names () const
 
std::vector< side_engine_ptr > & side_engines ()
 
const mp_game_settingsparams () const
 
bool first_scenario () const
 
bool force_lock_settings () const
 
bool receive_from_server (config &dst) const
 
const mp_campaign_infocampaign_info () const
 

Private Member Functions

 connect_engine (const connect_engine &)=delete
 
void operator= (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 ()
 
void send_to_server (const config &cfg) const
 

Private Attributes

config level_
 
saved_gamestate_
 
const mp_game_settingsparams_
 
const ng::controller default_controller_
 
mp_campaign_infocampaign_info_
 
const bool first_scenario_
 
bool force_lock_settings_
 
std::vector< side_engine_ptrside_engines_
 
std::vector< const config * > era_factions_
 
std::vector< std::string > team_names_
 
std::vector< std::string > user_team_names_
 
std::vector< std::string > player_teams_
 

Friends

class side_engine
 

Detailed Description

Definition at line 43 of file connect_engine.hpp.

Constructor & Destructor Documentation

ng::connect_engine::connect_engine ( saved_game state,
const bool  first_scenario,
mp_campaign_info campaign_info 
)
ng::connect_engine::connect_engine ( const connect_engine )
privatedelete

Member Function Documentation

const mp_campaign_info* ng::connect_engine::campaign_info ( ) const
inline

Definition at line 101 of file connect_engine.hpp.

References campaign_info_.

bool ng::connect_engine::can_start_game ( ) const
const std::set< std::string > & ng::connect_engine::connected_users ( ) const
std::set< std::string > & ng::connect_engine::connected_users_rw ( )
private

Definition at line 841 of file connect_engine.cpp.

References campaign_info_, and mp_campaign_info::connected_players.

Referenced by import_user(), and process_network_data().

config * ng::connect_engine::current_config ( )

Definition at line 195 of file connect_engine.cpp.

References s, and scenario().

Referenced by connect_engine(), and create_side_engine().

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

Definition at line 744 of file connect_engine.cpp.

References i, and side_engines_.

Referenced by process_network_data().

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

Definition at line 96 of file connect_engine.hpp.

References first_scenario_.

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

Definition at line 97 of file connect_engine.hpp.

References force_lock_settings_.

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

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

Definition at line 203 of file connect_engine.cpp.

References name().

Referenced by connect_engine(), load_previous_sides_users(), and process_network_data().

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

Definition at line 590 of file connect_engine.cpp.

References DBG_MP, and send_to_server().

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

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

Definition at line 81 of file connect_engine.hpp.

References level_.

void ng::connect_engine::load_previous_sides_users ( )
private
void ng::connect_engine::operator= ( const connect_engine )
privatedelete
const mp_game_settings& ng::connect_engine::params ( ) const
inline

Definition at line 95 of file connect_engine.hpp.

References params_.

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

std::pair< bool, bool > ng::connect_engine::process_network_data ( const config data)
bool ng::connect_engine::receive_from_server ( config dst) const
void ng::connect_engine::save_reserved_sides_information ( )
private
config& ng::connect_engine::scenario ( )
inline
void ng::connect_engine::send_level_data ( ) const
private
void ng::connect_engine::send_to_server ( const config cfg) const
private
std::vector<side_engine_ptr>& ng::connect_engine::side_engines ( )
inline
bool ng::connect_engine::sides_available ( ) const
void ng::connect_engine::start_game ( )
void ng::connect_engine::start_game_commandline ( const commandline_options cmdline_opts)
void ng::connect_engine::update_and_send_diff ( bool  update_time_of_day = false)
void ng::connect_engine::update_level ( )
void ng::connect_engine::update_side_controller_options ( )
private

Definition at line 824 of file connect_engine.cpp.

References side_engines_.

Referenced by import_user(), and process_network_data().

const std::vector<std::string>& ng::connect_engine::user_team_names ( ) const
inline

Definition at line 92 of file connect_engine.hpp.

References user_team_names_.

Friends And Related Function Documentation

friend class side_engine
friend

Definition at line 117 of file connect_engine.hpp.

Referenced by connect_engine().

Member Data Documentation

mp_campaign_info* ng::connect_engine::campaign_info_
private
const ng::controller ng::connect_engine::default_controller_
private
std::vector<const config*> ng::connect_engine::era_factions_
private

Definition at line 131 of file connect_engine.hpp.

Referenced by connect_engine(), and start_game_commandline().

const bool ng::connect_engine::first_scenario_
private
bool ng::connect_engine::force_lock_settings_
private

Definition at line 128 of file connect_engine.hpp.

Referenced by connect_engine(), force_lock_settings(), and start_game().

config ng::connect_engine::level_
private
const mp_game_settings& ng::connect_engine::params_
private
std::vector<std::string> ng::connect_engine::player_teams_
private

Definition at line 134 of file connect_engine.hpp.

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

std::vector<side_engine_ptr> ng::connect_engine::side_engines_
private
saved_game& ng::connect_engine::state_
private
std::vector<std::string> ng::connect_engine::team_names_
private
std::vector<std::string> ng::connect_engine::user_team_names_
private

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