The Battle for Wesnoth  1.15.0+dev
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)
 
std::string user_description () const
 
config new_config () const
 
bool ready_for_start () const
 
bool available_for_user (const std::string &name="") const
 
void resolve_random (randomness::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
 
const configcfg () const
 
ng::controller controller () const
 
unsigned current_controller_index () const
 
int index () const
 
void set_index (int index)
 
unsigned team () const
 
void set_team (unsigned team)
 
std::vector< std::string > get_children_to_swap ()
 
std::multimap< std::string, configget_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::string & player_id () const
 
const std::string & reserved_for () const
 
void set_reserved_for (const std::string &reserved_for)
 
const std::string & ai_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
 
flg_managerflg ()
 
const std::string color_id () const
 
const std::vector< std::string > & color_options () const
 
const std::string team_name () const
 
const std::string user_team_name () const
 

Private Member Functions

 side_engine (const side_engine &engine)=delete
 
void operator= (const side_engine &)=delete
 
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_
 
unsigned 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::vector< std::string > color_options_
 
std::string color_id_
 

Detailed Description

Definition at line 150 of file connect_engine.hpp.

Constructor & Destructor Documentation

◆ side_engine() [1/2]

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

◆ side_engine() [2/2]

ng::side_engine::side_engine ( const side_engine engine)
privatedelete

Member Function Documentation

◆ add_controller_option()

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

Definition at line 1374 of file connect_engine.cpp.

References cfg_, controller_lock_, and controller_options_.

Referenced by update_controller_options().

◆ ai_algorithm()

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

Definition at line 219 of file connect_engine.hpp.

◆ allow_changes()

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

Definition at line 223 of file connect_engine.hpp.

◆ allow_player()

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

Definition at line 222 of file connect_engine.hpp.

◆ allow_shuffle()

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

Definition at line 226 of file connect_engine.hpp.

◆ available_for_user()

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

Definition at line 1214 of file connect_engine.cpp.

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

Referenced by ready_for_start().

◆ cfg()

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

Definition at line 198 of file connect_engine.hpp.

◆ color()

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

Definition at line 209 of file connect_engine.hpp.

◆ color_id()

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

Definition at line 229 of file connect_engine.hpp.

◆ color_options()

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

Definition at line 230 of file connect_engine.hpp.

◆ controller()

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

Definition at line 199 of file connect_engine.hpp.

Referenced by set_controller().

◆ controller_changed()

bool ng::side_engine::controller_changed ( const int  selection)

◆ controller_options()

const std::vector<controller_option>& ng::side_engine::controller_options ( ) const
inline

Definition at line 196 of file connect_engine.hpp.

◆ current_controller_index()

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

Definition at line 200 of file connect_engine.hpp.

◆ flg()

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

Definition at line 227 of file connect_engine.hpp.

◆ get_children_to_swap()

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

Definition at line 370 of file connect_engine.cpp.

◆ get_side_children()

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

Definition at line 381 of file connect_engine.cpp.

References config::child_range().

◆ gold()

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

Definition at line 211 of file connect_engine.hpp.

◆ income()

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

Definition at line 213 of file connect_engine.hpp.

◆ index()

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

Definition at line 202 of file connect_engine.hpp.

◆ new_config()

config ng::side_engine::new_config ( ) const

◆ operator=()

void ng::side_engine::operator= ( const side_engine )
privatedelete

◆ place_user() [1/2]

void ng::side_engine::place_user ( const std::string &  name)

Definition at line 1260 of file connect_engine.cpp.

References name().

◆ place_user() [2/2]

void ng::side_engine::place_user ( const config data,
bool  contains_selection = false 
)

◆ player_id()

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

Definition at line 215 of file connect_engine.hpp.

◆ previous_save_id()

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

Definition at line 194 of file connect_engine.hpp.

◆ ready_for_start()

bool ng::side_engine::ready_for_start ( ) const

◆ reserved_for()

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

Definition at line 216 of file connect_engine.hpp.

◆ reset()

void ng::side_engine::reset ( )

◆ resolve_random()

void ng::side_engine::resolve_random ( randomness::mt_rng rng,
const std::vector< std::string > &  avoid_faction_ids = std::vector<std::string>() 
)

◆ save_id()

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

Definition at line 191 of file connect_engine.hpp.

◆ set_ai_algorithm()

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

Definition at line 220 of file connect_engine.hpp.

◆ set_color()

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

Definition at line 210 of file connect_engine.hpp.

◆ set_controller()

void ng::side_engine::set_controller ( ng::controller  controller)

◆ set_controller_commandline()

void ng::side_engine::set_controller_commandline ( const std::string &  controller_name)

◆ set_faction_commandline()

void ng::side_engine::set_faction_commandline ( const std::string &  faction_name)

Definition at line 1354 of file connect_engine.cpp.

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

◆ set_gold()

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

Definition at line 212 of file connect_engine.hpp.

◆ set_income()

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

Definition at line 214 of file connect_engine.hpp.

◆ set_index()

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

Definition at line 203 of file connect_engine.hpp.

References utf8::index().

◆ set_reserved_for()

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

Definition at line 217 of file connect_engine.hpp.

◆ set_side_children()

void ng::side_engine::set_side_children ( std::multimap< std::string, config children)

Definition at line 394 of file connect_engine.cpp.

◆ set_team()

void ng::side_engine::set_team ( unsigned  team)
inline

Definition at line 205 of file connect_engine.hpp.

◆ set_waiting_to_choose_status()

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

Definition at line 225 of file connect_engine.hpp.

Referenced by controller_changed(), and reset().

◆ team()

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

Definition at line 204 of file connect_engine.hpp.

◆ team_name()

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

Definition at line 232 of file connect_engine.hpp.

◆ update_controller_options()

void ng::side_engine::update_controller_options ( )

◆ update_current_controller_index()

void ng::side_engine::update_current_controller_index ( )

◆ user_description()

std::string ng::side_engine::user_description ( ) const

◆ user_team_name()

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

Definition at line 237 of file connect_engine.hpp.

References t_string::from_serialized().

◆ waiting_to_choose_faction()

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

Definition at line 224 of file connect_engine.hpp.

Member Data Documentation

◆ ai_algorithm_

std::string ng::side_engine::ai_algorithm_
private

Definition at line 271 of file connect_engine.hpp.

Referenced by new_config(), side_engine(), and user_description().

◆ allow_changes_

const bool ng::side_engine::allow_changes_
private

Definition at line 276 of file connect_engine.hpp.

Referenced by new_config(), and ready_for_start().

◆ allow_player_

const bool ng::side_engine::allow_player_
private

Definition at line 256 of file connect_engine.hpp.

Referenced by new_config(), ready_for_start(), side_engine(), and user_description().

◆ cfg_

config ng::side_engine::cfg_
private

Definition at line 249 of file connect_engine.hpp.

Referenced by add_controller_option(), new_config(), and side_engine().

◆ chose_random_

bool ng::side_engine::chose_random_
private

Definition at line 273 of file connect_engine.hpp.

Referenced by new_config(), and resolve_random().

◆ color_

int ng::side_engine::color_
private

Definition at line 261 of file connect_engine.hpp.

Referenced by side_engine().

◆ color_id_

std::string ng::side_engine::color_id_
private

Definition at line 281 of file connect_engine.hpp.

Referenced by new_config(), and side_engine().

◆ color_options_

std::vector<std::string> ng::side_engine::color_options_
private

Definition at line 279 of file connect_engine.hpp.

Referenced by side_engine().

◆ controller_

ng::controller ng::side_engine::controller_
private

◆ controller_lock_

const bool ng::side_engine::controller_lock_
private

Definition at line 257 of file connect_engine.hpp.

Referenced by add_controller_option().

◆ controller_options_

std::vector<controller_option> ng::side_engine::controller_options_
private

◆ current_controller_index_

unsigned ng::side_engine::current_controller_index_
private

Definition at line 253 of file connect_engine.hpp.

Referenced by update_current_controller_index().

◆ disallow_shuffle_

bool ng::side_engine::disallow_shuffle_
private

Definition at line 274 of file connect_engine.hpp.

◆ flg_

flg_manager ng::side_engine::flg_
private

◆ gold_

int ng::side_engine::gold_
private

Definition at line 262 of file connect_engine.hpp.

Referenced by new_config().

◆ income_

int ng::side_engine::income_
private

Definition at line 263 of file connect_engine.hpp.

Referenced by new_config().

◆ index_

int ng::side_engine::index_
private

Definition at line 259 of file connect_engine.hpp.

Referenced by new_config(), resolve_random(), and side_engine().

◆ parent_

connect_engine& ng::side_engine::parent_
private

◆ player_id_

std::string ng::side_engine::player_id_
private

◆ reserved_for_

std::string ng::side_engine::reserved_for_
private

◆ team_

unsigned ng::side_engine::team_
private

Definition at line 260 of file connect_engine.hpp.

Referenced by new_config(), and side_engine().

◆ waiting_to_choose_faction_

bool ng::side_engine::waiting_to_choose_faction_
private

Definition at line 277 of file connect_engine.hpp.

Referenced by place_user(), and ready_for_start().


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