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 | List of all members
ng::side_engine Class Reference

#include <connect_engine.hpp>

Public Member Functions

 side_engine (const config &cfg, connect_engine &parent_engine, const int index)
 
 ~side_engine ()
 
std::string user_description () const
 
config new_config () const
 
bool ready_for_start () const
 
bool available_for_user (const std::string &name="") const
 
bool swap_sides_on_drop_target (const unsigned drop_target)
 
void resolve_random (rand_rng::mt_rng &rng, const std::vector< std::string > &avoid_faction_ids=std::vector< std::string >())
 
void reset ()
 
void place_user (const std::string &name)
 
void place_user (const config &data, bool contains_selection=false)
 
void update_controller_options ()
 
void update_current_controller_index ()
 
bool controller_changed (const int selection)
 
void set_controller (ng::controller controller)
 
void set_faction_commandline (const std::string &faction_name)
 
void set_controller_commandline (const std::string &controller_name)
 
std::string save_id () const
 
std::string previous_save_id () const
 
const std::vector
< controller_option > & 
controller_options ()
 
const configcfg () const
 
ng::controller controller () const
 
unsigned current_controller_index () const
 
int index () const
 
void set_index (int index)
 
int team () const
 
void set_team (int team)
 
std::vector< std::stringget_children_to_swap ()
 
std::multimap< std::string,
config
get_side_children ()
 
void set_side_children (std::multimap< std::string, config > children)
 
int color () const
 
void set_color (int color)
 
int gold () const
 
void set_gold (int gold)
 
int income () const
 
void set_income (int income)
 
const std::stringplayer_id () const
 
const std::stringreserved_for () const
 
void set_reserved_for (const std::string &reserved_for)
 
const std::stringai_algorithm () const
 
void set_ai_algorithm (const std::string &ai_algorithm)
 
bool allow_player () const
 
bool allow_changes () const
 
bool waiting_to_choose_faction () const
 
void set_waiting_to_choose_status (bool status)
 
bool allow_shuffle () const
 
const std::vector< std::string > & player_teams () const
 
flg_managerflg ()
 
std::vector< std::stringget_colors () const
 
std::string get_color (int index=-1) const
 
int num_colors () const
 

Private Member Functions

 side_engine (const side_engine &engine)
 
void operator= (const side_engine &)
 
void add_controller_option (ng::controller controller, const std::string &name, const std::string &controller_value)
 

Private Attributes

config cfg_
 
connect_engineparent_
 
ng::controller controller_
 
unsigned current_controller_index_
 
std::vector< controller_optioncontroller_options_
 
const bool allow_player_
 
const bool controller_lock_
 
int index_
 
int team_
 
int color_
 
int gold_
 
int income_
 
std::string reserved_for_
 
std::string player_id_
 
std::string ai_algorithm_
 
bool chose_random_
 
bool disallow_shuffle_
 
flg_manager flg_
 
const bool allow_changes_
 
bool waiting_to_choose_faction_
 
std::string custom_color_
 

Detailed Description

Definition at line 139 of file connect_engine.hpp.

Constructor & Destructor Documentation

ng::side_engine::side_engine ( const config cfg,
connect_engine parent_engine,
const int  index 
)
ng::side_engine::~side_engine ( )

Definition at line 976 of file connect_engine.cpp.

ng::side_engine::side_engine ( const side_engine engine)
private

Member Function Documentation

void ng::side_engine::add_controller_option ( ng::controller  controller,
const std::string name,
const std::string controller_value 
)
private

Definition at line 1348 of file connect_engine.cpp.

References cfg_, controller_lock_, and controller_options_.

Referenced by update_controller_options().

const std::string& ng::side_engine::ai_algorithm ( ) const
inline

Definition at line 211 of file connect_engine.hpp.

References ai_algorithm_.

Referenced by set_ai_algorithm().

bool ng::side_engine::allow_changes ( ) const
inline

Definition at line 215 of file connect_engine.hpp.

References allow_changes_.

bool ng::side_engine::allow_player ( ) const
inline

Definition at line 214 of file connect_engine.hpp.

References allow_player_.

bool ng::side_engine::allow_shuffle ( ) const
inline

Definition at line 218 of file connect_engine.hpp.

References disallow_shuffle_.

bool ng::side_engine::available_for_user ( const std::string name = "") const

Definition at line 1155 of file connect_engine.cpp.

References ng::CNTR_NETWORK, ng::CNTR_RESERVED, controller_, player_id_, and reserved_for_.

Referenced by ready_for_start().

const config& ng::side_engine::cfg ( ) const
inline

Definition at line 190 of file connect_engine.hpp.

References cfg_.

int ng::side_engine::color ( ) const
inline

Definition at line 201 of file connect_engine.hpp.

References color_.

Referenced by get_color(), and set_color().

ng::controller ng::side_engine::controller ( ) const
inline

Definition at line 191 of file connect_engine.hpp.

References controller_.

Referenced by set_controller().

bool ng::side_engine::controller_changed ( const int  selection)
const std::vector<controller_option>& ng::side_engine::controller_options ( )
inline

Definition at line 188 of file connect_engine.hpp.

References controller_options_.

unsigned ng::side_engine::current_controller_index ( ) const
inline

Definition at line 192 of file connect_engine.hpp.

References current_controller_index_.

flg_manager& ng::side_engine::flg ( )
inline

Definition at line 221 of file connect_engine.hpp.

References flg_.

std::vector< std::string > ng::side_engine::get_children_to_swap ( )

Definition at line 369 of file connect_engine.cpp.

Referenced by get_side_children(), and set_side_children().

std::string ng::side_engine::get_color ( int  index = -1) const

Definition at line 1369 of file connect_engine.cpp.

References color(), and custom_color_.

Referenced by get_colors(), and new_config().

std::vector< std::string > ng::side_engine::get_colors ( ) const

Definition at line 1360 of file connect_engine.cpp.

References get_color(), mp::get_color_string(), i, and num_colors().

std::multimap< std::string, config > ng::side_engine::get_side_children ( )

Definition at line 380 of file connect_engine.cpp.

References cfg_, config::child_range(), and get_children_to_swap().

int ng::side_engine::gold ( ) const
inline

Definition at line 203 of file connect_engine.hpp.

References gold_.

Referenced by set_gold().

int ng::side_engine::income ( ) const
inline

Definition at line 205 of file connect_engine.hpp.

References income_.

Referenced by set_income().

int ng::side_engine::index ( ) const
inline

Definition at line 194 of file connect_engine.hpp.

References index_.

Referenced by set_index().

config ng::side_engine::new_config ( ) const
int ng::side_engine::num_colors ( ) const

Definition at line 1383 of file connect_engine.cpp.

References custom_color_, and gamemap::MAX_PLAYERS.

Referenced by get_colors().

void ng::side_engine::operator= ( const side_engine )
private
void ng::side_engine::place_user ( const std::string name)

Definition at line 1232 of file connect_engine.cpp.

Referenced by swap_sides_on_drop_target().

void ng::side_engine::place_user ( const config data,
bool  contains_selection = false 
)
const std::string& ng::side_engine::player_id ( ) const
inline

Definition at line 207 of file connect_engine.hpp.

References player_id_.

const std::vector<std::string>& ng::side_engine::player_teams ( ) const
inline

Definition at line 219 of file connect_engine.hpp.

References parent_, and ng::connect_engine::player_teams_.

std::string ng::side_engine::previous_save_id ( ) const
inline

Definition at line 186 of file connect_engine.hpp.

References cfg_, and save_id().

bool ng::side_engine::ready_for_start ( ) const
const std::string& ng::side_engine::reserved_for ( ) const
inline

Definition at line 208 of file connect_engine.hpp.

References reserved_for_.

Referenced by set_reserved_for().

void ng::side_engine::reset ( )
void ng::side_engine::resolve_random ( rand_rng::mt_rng rng,
const std::vector< std::string > &  avoid_faction_ids = std::vector<std::string>() 
)
std::string ng::side_engine::save_id ( ) const
inline

Definition at line 183 of file connect_engine.hpp.

References cfg_.

Referenced by previous_save_id().

void ng::side_engine::set_ai_algorithm ( const std::string ai_algorithm)
inline

Definition at line 212 of file connect_engine.hpp.

References ai_algorithm(), and ai_algorithm_.

void ng::side_engine::set_color ( int  color)
inline

Definition at line 202 of file connect_engine.hpp.

References color(), and color_.

void ng::side_engine::set_controller ( ng::controller  controller)
void ng::side_engine::set_controller_commandline ( const std::string controller_name)
void ng::side_engine::set_faction_commandline ( const std::string faction_name)

Definition at line 1329 of file connect_engine.cpp.

References flg_, and ng::flg_manager::set_current_faction().

void ng::side_engine::set_gold ( int  gold)
inline

Definition at line 204 of file connect_engine.hpp.

References gold(), and gold_.

void ng::side_engine::set_income ( int  income)
inline

Definition at line 206 of file connect_engine.hpp.

References income(), and income_.

void ng::side_engine::set_index ( int  index)
inline

Definition at line 195 of file connect_engine.hpp.

References index(), and index_.

void ng::side_engine::set_reserved_for ( const std::string reserved_for)
inline

Definition at line 209 of file connect_engine.hpp.

References reserved_for(), and reserved_for_.

void ng::side_engine::set_side_children ( std::multimap< std::string, config children)
void ng::side_engine::set_team ( int  team)
inline

Definition at line 197 of file connect_engine.hpp.

References team(), and team_.

void ng::side_engine::set_waiting_to_choose_status ( bool  status)
inline

Definition at line 217 of file connect_engine.hpp.

References waiting_to_choose_faction_.

Referenced by controller_changed(), and reset().

bool ng::side_engine::swap_sides_on_drop_target ( const unsigned  drop_target)
int ng::side_engine::team ( ) const
inline

Definition at line 196 of file connect_engine.hpp.

References team_.

Referenced by set_team().

void ng::side_engine::update_controller_options ( )
void ng::side_engine::update_current_controller_index ( )
std::string ng::side_engine::user_description ( ) const
bool ng::side_engine::waiting_to_choose_faction ( ) const
inline

Definition at line 216 of file connect_engine.hpp.

References waiting_to_choose_faction_.

Member Data Documentation

std::string ng::side_engine::ai_algorithm_
private
const bool ng::side_engine::allow_changes_
private

Definition at line 260 of file connect_engine.hpp.

Referenced by allow_changes(), new_config(), and ready_for_start().

const bool ng::side_engine::allow_player_
private
config ng::side_engine::cfg_
private
bool ng::side_engine::chose_random_
private

Definition at line 257 of file connect_engine.hpp.

Referenced by new_config(), and resolve_random().

int ng::side_engine::color_
private

Definition at line 245 of file connect_engine.hpp.

Referenced by color(), new_config(), set_color(), and side_engine().

ng::controller ng::side_engine::controller_
private
const bool ng::side_engine::controller_lock_
private

Definition at line 241 of file connect_engine.hpp.

Referenced by add_controller_option(), and swap_sides_on_drop_target().

std::vector<controller_option> ng::side_engine::controller_options_
private
unsigned ng::side_engine::current_controller_index_
private
std::string ng::side_engine::custom_color_
private

Definition at line 262 of file connect_engine.hpp.

Referenced by get_color(), num_colors(), and side_engine().

bool ng::side_engine::disallow_shuffle_
private

Definition at line 258 of file connect_engine.hpp.

Referenced by allow_shuffle().

flg_manager ng::side_engine::flg_
private
int ng::side_engine::gold_
private

Definition at line 246 of file connect_engine.hpp.

Referenced by gold(), new_config(), and set_gold().

int ng::side_engine::income_
private

Definition at line 247 of file connect_engine.hpp.

Referenced by income(), new_config(), and set_income().

int ng::side_engine::index_
private

Definition at line 243 of file connect_engine.hpp.

Referenced by index(), new_config(), resolve_random(), and set_index().

connect_engine& ng::side_engine::parent_
private
std::string ng::side_engine::player_id_
private
std::string ng::side_engine::reserved_for_
private
int ng::side_engine::team_
private

Definition at line 244 of file connect_engine.hpp.

Referenced by new_config(), set_team(), side_engine(), and team().

bool ng::side_engine::waiting_to_choose_faction_
private

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