52 void import_user(
const std::string& name,
const bool observer,
54 void import_user(
const config&
data,
const bool observer,
58 bool sides_available()
const;
63 void update_and_send_diff();
65 bool can_start_game()
const;
73 std::pair<bool, bool> process_network_data(
const config& data);
77 int find_user_side_index_by_id(
const std::string&
id)
const;
87 else if(
config& snapshot = level_.
child(
"snapshot"))
90 throw "No scenariodata found";
92 const std::set<std::string>& connected_users()
const;
116 void send_level_data()
const;
118 void save_reserved_sides_information();
119 void load_previous_sides_users();
121 void update_side_controller_options();
140 std::set<std::string>& connected_users_rw();
152 std::string user_description()
const;
155 config new_config()
const;
162 bool available_for_user(
const std::string& name =
"")
const;
164 void resolve_random(
randomness::mt_rng & rng,
const std::vector<std::string> & avoid_faction_ids = std::vector<std::string>());
170 void place_user(
const std::string& name);
171 void place_user(
const config&
data,
bool contains_selection =
false);
173 void update_controller_options();
174 void update_current_controller_index();
175 bool controller_changed(
const int selection);
179 void set_faction_commandline(
const std::string& faction_name);
185 {
return (!cfg_[
"save_id"].empty()) ? cfg_[
"save_id"] : cfg_[
"id"]; }
188 {
return (!cfg_[
"previous_save_id"].empty()) ? cfg_[
"previous_save_id"] : save_id(); }
190 {
return controller_options_; }
194 {
return current_controller_index_; }
195 int index()
const {
return index_; }
197 unsigned team()
const {
return team_; }
199 std::multimap<std::string, config> get_side_children();
200 void set_side_children(std::multimap<std::string, config> children);
201 int color()
const {
return color_; }
202 void set_color(
int color) { color_ = color; color_id_ = color_options_[color]; }
203 int gold()
const {
return gold_; }
207 const std::string&
player_id()
const {
return player_id_; }
210 { reserved_for_ = reserved_for; }
213 { ai_algorithm_ = ai_algorithm; }
221 const std::string
color_id()
const {
return color_id_; }
222 const std::vector<std::string>&
color_options()
const {
return color_options_; }
226 return parent_.team_data_[team_].team_name;
241 const std::string& name,
const std::string& controller_value);
config & child(config_key_type key, int n=0)
Returns the nth child with the given key, or a reference to an invalid config if there is none...
void set_waiting_to_choose_status(bool status)
void set_reserved_for(const std::string &reserved_for)
std::vector< side_engine_ptr > side_engines_
std::string save_id() const
void set_income(int income)
bool force_lock_settings() const
std::string ai_algorithm_
bool allow_changes() const
std::vector< team_data_pod > team_data_
const bool allow_changes_
FLG stands for faction, leader and gender.
const std::vector< team_data_pod > & team_data() const
std::vector< controller_option > controller_options_
Definitions for the interface to Wesnoth Markup Language (WML).
void set_color(int color)
mp_game_metadata * mp_metadata_
bool waiting_to_choose_faction_
This class stores all the data for a single 'side' (in game nomenclature).
std::vector< side_engine_ptr > & side_engines()
std::string ready_for_start
const std::string & reserved_for() const
const std::string & player_id() const
const std::string team_name() const
const std::string & ai_algorithm() const
const mp_game_settings & params() const
std::vector< std::string > color_options_
const bool first_scenario_
ng::controller controller_
const std::string color_id() const
std::vector< const config * > era_factions_
const ng::controller default_controller_
Game configuration data as global variables.
bool allow_shuffle() const
void set_ai_algorithm(const std::string &ai_algorithm)
std::string reserved_for_
static t_string from_serialized(const std::string &string)
bool allow_player() const
const config & level() const
std::size_t index(const std::string &str, const std::size_t index)
Codepoint index corresponding to the nth character in a UTF-8 string.
unsigned current_controller_index_
std::shared_ptr< side_engine > side_engine_ptr
const std::string user_team_name() const
std::pair< ng::controller, std::string > controller_option
std::string user_team_name
void set_index(int index)
std::string previous_save_id() const
const bool controller_lock_
const config & cfg() const
const mp_game_settings & params_
bool first_scenario() const
const std::vector< controller_option > & controller_options() const
ng::controller controller() const
A config object defines a single node in a WML file, with access to child nodes.
bool waiting_to_choose_faction() const
unsigned current_controller_index() const
static std::string controller_name(const team &t)
void set_team(unsigned team)
bool force_lock_settings_
const std::vector< std::string > & color_options() const