The Battle for Wesnoth  1.19.7+dev
Public Member Functions | Private Member Functions | Private Attributes | Friends | 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::multimap< std::string, configget_side_children ()
 
void set_side_children (const 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
 
side_engineoperator= (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_
 

Friends

class connect_engine
 

Detailed Description

Definition at line 142 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 1285 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 210 of file connect_engine.hpp.

References ai_algorithm_.

Referenced by set_ai_algorithm().

◆ allow_changes()

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

Definition at line 214 of file connect_engine.hpp.

References allow_changes_.

◆ allow_player()

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

Definition at line 213 of file connect_engine.hpp.

References allow_player_.

◆ allow_shuffle()

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

Definition at line 217 of file connect_engine.hpp.

References disallow_shuffle_.

◆ available_for_user()

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

Definition at line 1125 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 190 of file connect_engine.hpp.

References cfg_.

Referenced by side_engine().

◆ color()

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

Definition at line 200 of file connect_engine.hpp.

References color_.

Referenced by set_color().

◆ color_id()

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

Definition at line 220 of file connect_engine.hpp.

References color_id_.

◆ color_options()

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

Definition at line 221 of file connect_engine.hpp.

References color_options_.

◆ controller()

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

Definition at line 191 of file connect_engine.hpp.

References controller_.

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 188 of file connect_engine.hpp.

References controller_options_.

◆ current_controller_index()

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

Definition at line 192 of file connect_engine.hpp.

References current_controller_index_.

◆ flg()

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

Definition at line 218 of file connect_engine.hpp.

References flg_.

◆ get_side_children()

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

Definition at line 359 of file connect_engine.cpp.

References config::child_range().

◆ gold()

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

Definition at line 202 of file connect_engine.hpp.

References gold_.

Referenced by set_gold().

◆ income()

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

Definition at line 204 of file connect_engine.hpp.

References income_.

Referenced by set_income().

◆ index()

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

Definition at line 194 of file connect_engine.hpp.

References index_.

Referenced by set_index().

◆ new_config()

config ng::side_engine::new_config ( ) const

◆ operator=()

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

◆ place_user() [1/2]

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

◆ place_user() [2/2]

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

Definition at line 1171 of file connect_engine.cpp.

References data.

◆ player_id()

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

Definition at line 206 of file connect_engine.hpp.

References player_id_.

◆ previous_save_id()

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

Definition at line 186 of file connect_engine.hpp.

References cfg_, and save_id().

◆ 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 207 of file connect_engine.hpp.

References reserved_for_.

Referenced by set_reserved_for().

◆ 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 183 of file connect_engine.hpp.

References cfg_.

Referenced by previous_save_id().

◆ set_ai_algorithm()

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

Definition at line 211 of file connect_engine.hpp.

References ai_algorithm(), and ai_algorithm_.

◆ set_color()

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

Definition at line 201 of file connect_engine.hpp.

References color(), color_, color_id_, and color_options_.

◆ 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 1265 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 203 of file connect_engine.hpp.

References gold(), and gold_.

◆ set_income()

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

Definition at line 205 of file connect_engine.hpp.

References income(), and income_.

◆ set_index()

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

Definition at line 195 of file connect_engine.hpp.

References index(), and index_.

◆ set_reserved_for()

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

Definition at line 208 of file connect_engine.hpp.

References reserved_for(), and reserved_for_.

◆ set_side_children()

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

Definition at line 372 of file connect_engine.cpp.

◆ set_team()

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

Definition at line 197 of file connect_engine.hpp.

References team(), and team_.

◆ set_waiting_to_choose_status()

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

Definition at line 216 of file connect_engine.hpp.

References waiting_to_choose_faction_.

Referenced by controller_changed(), and reset().

◆ team()

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

Definition at line 196 of file connect_engine.hpp.

References team_.

Referenced by set_team().

◆ team_name()

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

Definition at line 223 of file connect_engine.hpp.

References parent_, team_, and ng::connect_engine::team_data_.

◆ 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

◆ waiting_to_choose_faction()

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

Definition at line 215 of file connect_engine.hpp.

References waiting_to_choose_faction_.

Friends And Related Function Documentation

◆ connect_engine

friend class connect_engine
friend

Definition at line 237 of file connect_engine.hpp.

Member Data Documentation

◆ ai_algorithm_

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

◆ allow_changes_

const bool ng::side_engine::allow_changes_
private

Definition at line 269 of file connect_engine.hpp.

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

◆ allow_player_

const bool ng::side_engine::allow_player_
private

◆ cfg_

config ng::side_engine::cfg_
private

◆ chose_random_

bool ng::side_engine::chose_random_
private

Definition at line 266 of file connect_engine.hpp.

Referenced by new_config(), and resolve_random().

◆ color_

int ng::side_engine::color_
private

Definition at line 254 of file connect_engine.hpp.

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

◆ color_id_

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

Definition at line 274 of file connect_engine.hpp.

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

◆ color_options_

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

Definition at line 272 of file connect_engine.hpp.

Referenced by color_options(), set_color(), and side_engine().

◆ controller_

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

◆ controller_lock_

const bool ng::side_engine::controller_lock_
private

Definition at line 250 of file connect_engine.hpp.

Referenced by add_controller_option(), and new_config().

◆ controller_options_

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

◆ current_controller_index_

unsigned ng::side_engine::current_controller_index_
private

◆ disallow_shuffle_

bool ng::side_engine::disallow_shuffle_
private

Definition at line 267 of file connect_engine.hpp.

Referenced by allow_shuffle().

◆ flg_

flg_manager ng::side_engine::flg_
private

◆ gold_

int ng::side_engine::gold_
private

Definition at line 255 of file connect_engine.hpp.

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

◆ income_

int ng::side_engine::income_
private

Definition at line 256 of file connect_engine.hpp.

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

◆ index_

int ng::side_engine::index_
private

Definition at line 252 of file connect_engine.hpp.

Referenced by index(), new_config(), resolve_random(), set_index(), 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 253 of file connect_engine.hpp.

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

◆ waiting_to_choose_faction_

bool ng::side_engine::waiting_to_choose_faction_
private

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