The Battle for Wesnoth  1.13.4+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)
 
 ~connect_engine ()
 
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)
 
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 ()
 
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 &)
 
void operator= (const connect_engine &)
 
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
 
bool receive_from_server (config &dst) 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::stringteam_names_
 
std::vector< std::stringuser_team_names_
 
std::vector< std::stringplayer_teams_
 

Friends

class side_engine
 

Detailed Description

Definition at line 47 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 ( )

Definition at line 207 of file connect_engine.cpp.

ng::connect_engine::connect_engine ( const connect_engine )
private

Member Function Documentation

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 861 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 211 of file connect_engine.cpp.

References 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 763 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 101 of file connect_engine.hpp.

References first_scenario_.

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

Definition at line 102 of file connect_engine.hpp.

References force_lock_settings_.

Referenced by mp::connect::force_lock_settings().

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

Definition at line 86 of file connect_engine.hpp.

References level_.

Referenced by mp::connect::connect().

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

Definition at line 100 of file connect_engine.hpp.

References params_.

Referenced by mp::connect::params().

std::pair< bool, bool > ng::connect_engine::process_network_data ( const config data)
bool ng::connect_engine::receive_from_server ( config dst) const
private
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

Definition at line 99 of file connect_engine.hpp.

References side_engines_.

Referenced by mp::connect::connect(), and ng::side_engine::side_engine().

bool ng::connect_engine::sides_available ( ) const

Definition at line 282 of file connect_engine.cpp.

References side_engines_.

Referenced by mp::connect::update_playerlist_state().

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 843 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 ( )
inline

Definition at line 97 of file connect_engine.hpp.

References user_team_names_.

Friends And Related Function Documentation

friend class side_engine
friend

Definition at line 115 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 129 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 126 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 132 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: