The Battle for Wesnoth  1.19.1+dev
Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
team Class Reference

This class stores all the data for a single 'side' (in game nomenclature). More...

#include <team.hpp>

Classes

struct  team_info
 

Public Member Functions

 team ()
 
virtual ~team ()
 
void build (const config &cfg, const gamemap &map, int gold=default_team_gold_)
 
void write (config &cfg) const
 
void fix_villages (const gamemap &map)
 
game_events::pump_result_t get_village (const map_location &, const int owner_side, game_data *fire_event)
 Acquires a village from owner_side. More...
 
void lose_village (const map_location &)
 
void clear_villages ()
 
const std::set< map_location > & villages () const
 
bool owns_village (const map_location &loc) const
 
int side () const
 
int gold () const
 
int start_gold () const
 
int base_income () const
 
int village_gold () const
 
int recall_cost () const
 
void set_village_gold (int income)
 
void set_recall_cost (int cost)
 
int total_income () const
 
int village_support () const
 
void set_village_support (int support)
 
int support () const
 Calculate total support capacity, based on support_per_village. More...
 
void new_turn ()
 
void get_shared_maps ()
 
void set_gold (int amount)
 
void set_start_gold (const int amount)
 
void spend_gold (const int amount)
 
void set_base_income (int amount)
 
int countdown_time () const
 
void set_countdown_time (const int amount) const
 
int action_bonus_count () const
 
void set_action_bonus_count (const int count)
 
recall_list_managerrecall_list ()
 
const recall_list_managerrecall_list () const
 
void set_current_player (const std::string &player)
 
bool get_scroll_to_leader () const
 
void set_scroll_to_leader (bool value)
 
const std::set< std::string > & recruits () const
 
void add_recruit (const std::string &)
 
void set_recruits (const std::set< std::string > &recruits)
 
int minimum_recruit_price () const
 
const std::string & last_recruit () const
 
void last_recruit (const std::string &u_type)
 
const std::string & save_id () const
 
std::string save_id_or_number () const
 
void set_save_id (const std::string &save_id)
 
const std::string & current_player () const
 
void set_objectives (const t_string &new_objectives, bool silently=false)
 
void set_objectives_changed (bool c=true) const
 
void reset_objectives_changed () const
 
const t_stringobjectives () const
 
bool objectives_changed () const
 
bool is_enemy (int n) const
 
side_controller::type controller () const
 
const std::string & color () const
 
void set_color (const std::string &color)
 
bool is_empty () const
 
bool is_local () const
 
bool is_network () const
 
bool is_human () const
 
bool is_ai () const
 
bool is_local_human () const
 
bool is_local_ai () const
 
bool is_network_human () const
 
bool is_network_ai () const
 
void set_local (bool local)
 
void make_human ()
 
void make_ai ()
 
void change_controller (const std::string &new_controller)
 
void change_controller (side_controller::type controller)
 
void change_controller_by_wml (const std::string &new_controller)
 
side_proxy_controller::type proxy_controller () const
 
bool is_proxy_human () const
 
bool is_droid () const
 
bool is_idle () const
 
void make_droid ()
 
void make_idle ()
 
void make_proxy_human ()
 
void clear_proxy ()
 
void change_proxy (side_proxy_controller::type proxy)
 
void toggle_droid ()
 
void toggle_idle ()
 
const std::string & team_name () const
 
const t_stringuser_team_name () const
 
void change_team (const std::string &name, const t_string &user_name)
 
const std::string & flag () const
 
const std::string & flag_icon () const
 
void set_flag (const std::string &flag)
 
void set_flag_icon (const std::string &flag_icon)
 
const std::string & side_name () const
 
t_string side_name_tstr () const
 
void set_side_name (const t_string &new_name)
 
const std::string & faction () const
 
const t_stringfaction_name () const
 
bool shrouded (const map_location &loc) const
 
bool fogged (const map_location &loc) const
 
bool uses_shroud () const
 
bool uses_fog () const
 
bool fog_or_shroud () const
 
bool clear_shroud (const map_location &loc)
 
void place_shroud (const map_location &loc)
 
bool clear_fog (const map_location &loc)
 
void reshroud ()
 
void refog ()
 
void set_shroud (bool shroud)
 
void set_fog (bool fog)
 
std::string shroud_data () const
 
void merge_shroud_map_data (const std::string &shroud_data)
 Merge a WML shroud map with the shroud data of this player. More...
 
bool knows_about_team (std::size_t index) const
 
void add_fog_override (const std::set< map_location > &hexes)
 Records hexes that were cleared of fog via WML. More...
 
void remove_fog_override (const std::set< map_location > &hexes)
 Removes the record of hexes that were cleared of fog via WML. More...
 
bool auto_shroud_updates () const
 
void set_auto_shroud_updates (bool value)
 
bool get_disallow_observers () const
 
bool no_leader () const
 
defeat_condition::type defeat_cond () const
 
void set_defeat_condition (defeat_condition::type value)
 
void set_defeat_condition_string (const std::string &value)
 sets the defeat condition if More...
 
void have_leader (bool value=true)
 
bool hidden () const
 
void set_hidden (bool value)
 
bool persistent () const
 
void set_persistent (bool value)
 
void set_lost (bool value=true)
 
bool lost () const
 
void set_carryover_percentage (int value)
 
int carryover_percentage () const
 
void set_carryover_add (bool value)
 
bool carryover_add () const
 
void set_carryover_bonus (double value)
 
double carryover_bonus () const
 
void set_carryover_gold (int value)
 
int carryover_gold () const
 
configvariables ()
 
const configvariables () const
 
bool no_turn_confirmation () const
 
void set_no_turn_confirmation (bool value)
 
void log_recruitable () const
 
std::shared_ptr< wb::side_actionsget_side_actions () const
 get the whiteboard planned actions for this team More...
 
config to_config () const
 
bool share_maps () const
 
bool share_view () const
 
team_shared_vision::type share_vision () const
 
void set_share_vision (const std::string &vision_status)
 
void set_share_vision (team_shared_vision::type vision_status)
 
void handle_legacy_share_vision (const config &cfg)
 
std::string allied_human_teams () const
 
bool chose_random () const
 

Static Public Member Functions

static const color_range get_side_color_range (int side)
 
static color_t get_side_color (int side)
 
static color_t get_minimap_color (int side)
 
static std::string get_side_color_id (unsigned side)
 
static const t_string get_side_color_name_for_UI (unsigned side)
 
static std::string get_side_color_id_from_config (const config &cfg)
 
static std::string get_side_highlight_pango (int side)
 
static void clear_caches ()
 clear the shroud, fog, and enemies cache for all teams More...
 

Static Public Attributes

static const std::set< std::string > attributes
 Stores the attributes recognized by [side]. More...
 

Private Member Functions

const std::vector< const shroud_map * > & ally_shroud (const std::vector< team > &teams) const
 
const std::vector< const shroud_map * > & ally_fog (const std::vector< team > &teams) const
 
void calculate_enemies (std::size_t index) const
 
bool calculate_is_enemy (std::size_t index) const
 

Private Attributes

int gold_
 
std::set< map_locationvillages_
 
shroud_map shroud_
 
shroud_map fog_
 
std::set< map_locationfog_clearer_
 Stores hexes that have been cleared of fog via WML. More...
 
bool auto_shroud_updates_
 
team_info info_
 
int countdown_time_
 
int action_bonus_count_
 
recall_list_manager recall_list_
 
std::string last_recruit_
 
boost::dynamic_bitset enemies_
 
std::vector< const shroud_map * > ally_shroud_
 
std::vector< const shroud_map * > ally_fog_
 
std::shared_ptr< wb::side_actionsplanned_actions_
 Whiteboard planned actions for this team. More...
 

Static Private Attributes

static const int default_team_gold_ = 100
 

Detailed Description

This class stores all the data for a single 'side' (in game nomenclature).

E.g., there is only one leader unit per team.

Definition at line 73 of file team.hpp.

Constructor & Destructor Documentation

◆ team()

team::team ( )

Definition at line 329 of file team.cpp.

◆ ~team()

team::~team ( )
virtual

Definition at line 348 of file team.cpp.

Member Function Documentation

◆ action_bonus_count()

int team::action_bonus_count ( ) const
inline

◆ add_fog_override()

void team::add_fog_override ( const std::set< map_location > &  hexes)
inline

Records hexes that were cleared of fog via WML.

Definition at line 320 of file team.hpp.

References fog_clearer_.

◆ add_recruit()

void team::add_recruit ( const std::string &  recruit)

◆ allied_human_teams()

std::string team::allied_human_teams ( ) const

Definition at line 1053 of file team.cpp.

References resources::gameboard, utils::join(), and t.

◆ ally_fog()

const std::vector< const shroud_map * > & team::ally_fog ( const std::vector< team > &  teams) const
private

Definition at line 690 of file team.cpp.

References ally_fog_, fog_, i, is_enemy(), and share_view().

Referenced by fogged().

◆ ally_shroud()

const std::vector< const shroud_map * > & team::ally_shroud ( const std::vector< team > &  teams) const
private

Definition at line 677 of file team.cpp.

References ally_shroud_, i, is_enemy(), share_maps(), share_view(), and shroud_.

Referenced by shrouded().

◆ auto_shroud_updates()

bool team::auto_shroud_updates ( ) const
inline

◆ base_income()

int team::base_income ( ) const
inline

◆ build()

void team::build ( const config cfg,
const gamemap map,
int  gold = default_team_gold_ 
)

◆ calculate_enemies()

void team::calculate_enemies ( std::size_t  index) const
private

Definition at line 508 of file team.cpp.

References calculate_is_enemy(), enemies_, resources::gameboard, utf8::index(), and utf8::size().

Referenced by is_enemy().

◆ calculate_is_enemy()

bool team::calculate_is_enemy ( std::size_t  index) const
private

◆ carryover_add()

bool team::carryover_add ( ) const
inline

◆ carryover_bonus()

double team::carryover_bonus ( ) const
inline

◆ carryover_gold()

int team::carryover_gold ( ) const
inline

Definition at line 347 of file team.hpp.

References team::team_info::carryover_gold, and info_.

Referenced by team::team_info::read(), and team::team_info::write().

◆ carryover_percentage()

int team::carryover_percentage ( ) const
inline

◆ change_controller() [1/2]

void team::change_controller ( const std::string &  new_controller)
inline

◆ change_controller() [2/2]

void team::change_controller ( side_controller::type  controller)
inline

Definition at line 264 of file team.hpp.

References team::team_info::controller, controller(), and info_.

◆ change_controller_by_wml()

void team::change_controller_by_wml ( const std::string &  new_controller)

◆ change_proxy()

void team::change_proxy ( side_proxy_controller::type  proxy)
inline

Definition at line 277 of file team.hpp.

References info_, and team::team_info::proxy_controller.

Referenced by game_board::side_drop_to().

◆ change_team()

void team::change_team ( const std::string &  name,
const t_string user_name 
)

◆ chose_random()

bool team::chose_random ( ) const
inline

Definition at line 395 of file team.hpp.

References team::team_info::chose_random, and info_.

Referenced by team::team_info::read(), and team::team_info::write().

◆ clear_caches()

void team::clear_caches ( )
static

clear the shroud, fog, and enemies cache for all teams

Definition at line 629 of file team.cpp.

References resources::gameboard, and t.

Referenced by change_team(), and set_share_vision().

◆ clear_fog()

bool team::clear_fog ( const map_location loc)
inline

◆ clear_proxy()

void team::clear_proxy ( )
inline

Definition at line 275 of file team.hpp.

References make_proxy_human().

◆ clear_shroud()

bool team::clear_shroud ( const map_location loc)
inline

◆ clear_villages()

void team::clear_villages ( )
inline

Definition at line 169 of file team.hpp.

References villages_.

◆ color()

const std::string& team::color ( ) const
inline

◆ controller()

side_controller::type team::controller ( ) const
inline

◆ countdown_time()

int team::countdown_time ( ) const
inline

◆ current_player()

const std::string& team::current_player ( ) const
inline

◆ defeat_cond()

defeat_condition::type team::defeat_cond ( ) const
inline

Definition at line 328 of file team.hpp.

References team::team_info::defeat_cond, and info_.

Referenced by team::team_info::read(), and team::team_info::write().

◆ faction()

const std::string& team::faction ( ) const
inline

◆ faction_name()

const t_string& team::faction_name ( ) const
inline

◆ fix_villages()

void team::fix_villages ( const gamemap map)

Definition at line 424 of file team.cpp.

References gamemap::is_village(), and villages_.

◆ flag()

const std::string& team::flag ( ) const
inline

◆ flag_icon()

const std::string& team::flag_icon ( ) const
inline

◆ fog_or_shroud()

bool team::fog_or_shroud ( ) const
inline

◆ fogged()

bool team::fogged ( const map_location loc) const

◆ get_disallow_observers()

bool team::get_disallow_observers ( ) const
inline

Definition at line 326 of file team.hpp.

References team::team_info::disallow_observers, and info_.

◆ get_minimap_color()

color_t team::get_minimap_color ( int  side)
static

◆ get_scroll_to_leader()

bool team::get_scroll_to_leader ( ) const
inline

Definition at line 206 of file team.hpp.

References info_, and team::team_info::scroll_to_leader.

◆ get_shared_maps()

void team::get_shared_maps ( )

◆ get_side_actions()

std::shared_ptr<wb::side_actions> team::get_side_actions ( ) const
inline

◆ get_side_color()

color_t team::get_side_color ( int  side)
static

◆ get_side_color_id()

std::string team::get_side_color_id ( unsigned  side)
static

◆ get_side_color_id_from_config()

std::string team::get_side_color_id_from_config ( const config cfg)
static

◆ get_side_color_name_for_UI()

const t_string team::get_side_color_name_for_UI ( unsigned  side)
static

◆ get_side_color_range()

const color_range team::get_side_color_range ( int  side)
static

◆ get_side_highlight_pango()

std::string team::get_side_highlight_pango ( int  side)
static

◆ get_village()

game_events::pump_result_t team::get_village ( const map_location loc,
const int  owner_side,
game_data fire_event 
)

Acquires a village from owner_side.

Pointer fire_event should be the game_data for the game if it is desired to fire an event – a "capture" event with owner_side variable scoped in will be fired. For no event, pass it nullptr. Default is the resources::gamedata pointer.

Definition at line 436 of file team.cpp.

References config_attribute_value::blank(), game_events::wml_event_pump::fire(), resources::game_events, gamedata, game_events::manager::pump(), and villages_.

Referenced by game_lua_kernel::intf_set_village_owner().

◆ gold()

int team::gold ( ) const
inline

◆ handle_legacy_share_vision()

void team::handle_legacy_share_vision ( const config cfg)
inline

Definition at line 389 of file team.hpp.

References team::team_info::handle_legacy_share_vision(), and info_.

Referenced by team::team_info::read().

◆ have_leader()

void team::have_leader ( bool  value = true)
inline

Definition at line 332 of file team.hpp.

References info_, and team::team_info::no_leader.

◆ hidden()

bool team::hidden ( ) const
inline

◆ is_ai()

bool team::is_ai ( ) const
inline

◆ is_droid()

bool team::is_droid ( ) const
inline

Definition at line 269 of file team.hpp.

References info_, and team::team_info::proxy_controller.

◆ is_empty()

bool team::is_empty ( ) const
inline

◆ is_enemy()

bool team::is_enemy ( int  n) const
inline

◆ is_human()

bool team::is_human ( ) const
inline

◆ is_idle()

bool team::is_idle ( ) const
inline

Definition at line 270 of file team.hpp.

References info_, and team::team_info::proxy_controller.

Referenced by gui2::dialogs::mp_change_control::pre_show().

◆ is_local()

bool team::is_local ( ) const
inline

◆ is_local_ai()

bool team::is_local_ai ( ) const
inline

◆ is_local_human()

bool team::is_local_human ( ) const
inline

◆ is_network()

bool team::is_network ( ) const
inline

◆ is_network_ai()

bool team::is_network_ai ( ) const
inline

Definition at line 256 of file team.hpp.

References is_ai(), and is_network().

Referenced by gui2::dialogs::mp_change_control::pre_show(), and SYNCED_COMMAND_HANDLER_FUNCTION().

◆ is_network_human()

bool team::is_network_human ( ) const
inline

Definition at line 255 of file team.hpp.

References is_human(), and is_network().

◆ is_proxy_human()

bool team::is_proxy_human ( ) const
inline

Definition at line 268 of file team.hpp.

References info_, and team::team_info::proxy_controller.

◆ knows_about_team()

bool team::knows_about_team ( std::size_t  index) const

◆ last_recruit() [1/2]

const std::string& team::last_recruit ( ) const
inline

Definition at line 214 of file team.hpp.

References last_recruit_.

Referenced by events::menu_handler::can_recruit().

◆ last_recruit() [2/2]

void team::last_recruit ( const std::string &  u_type)
inline

Definition at line 215 of file team.hpp.

References last_recruit_.

◆ log_recruitable()

void team::log_recruitable ( ) const

Definition at line 1035 of file team.cpp.

References team::team_info::can_recruit, info_, and LOG_NG.

◆ lose_village()

void team::lose_village ( const map_location loc)

◆ lost()

bool team::lost ( ) const
inline

Definition at line 338 of file team.hpp.

References info_, and team::team_info::lost.

Referenced by team::team_info::read(), and team::team_info::write().

◆ make_ai()

void team::make_ai ( )
inline

◆ make_droid()

void team::make_droid ( )
inline

Definition at line 272 of file team.hpp.

References info_, and team::team_info::proxy_controller.

◆ make_human()

void team::make_human ( )
inline

◆ make_idle()

void team::make_idle ( )
inline

Definition at line 273 of file team.hpp.

References info_, and team::team_info::proxy_controller.

◆ make_proxy_human()

void team::make_proxy_human ( )
inline

Definition at line 274 of file team.hpp.

References info_, and team::team_info::proxy_controller.

Referenced by clear_proxy().

◆ merge_shroud_map_data()

void team::merge_shroud_map_data ( const std::string &  shroud_data)
inline

Merge a WML shroud map with the shroud data of this player.

Definition at line 316 of file team.hpp.

References shroud_map::merge(), shroud_, and shroud_data().

◆ minimum_recruit_price()

int team::minimum_recruit_price ( ) const

◆ new_turn()

void team::new_turn ( )
inline

Definition at line 190 of file team.hpp.

References gold_, and total_income().

Referenced by play_controller::do_init_side().

◆ no_leader()

bool team::no_leader ( ) const
inline

◆ no_turn_confirmation()

bool team::no_turn_confirmation ( ) const
inline

Definition at line 351 of file team.hpp.

References info_, and team::team_info::no_turn_confirmation.

Referenced by team::team_info::read(), and team::team_info::write().

◆ objectives()

const t_string& team::objectives ( ) const
inline

◆ objectives_changed()

bool team::objectives_changed ( ) const
inline

Definition at line 227 of file team.hpp.

References info_, and team::team_info::objectives_changed.

Referenced by team::team_info::read(), and team::team_info::write().

◆ owns_village()

bool team::owns_village ( const map_location loc) const
inline

◆ persistent()

bool team::persistent ( ) const
inline

◆ place_shroud()

void team::place_shroud ( const map_location loc)
inline

Definition at line 307 of file team.hpp.

References shroud_map::place(), shroud_, map_location::wml_x(), and map_location::wml_y().

◆ proxy_controller()

side_proxy_controller::type team::proxy_controller ( ) const
inline

Definition at line 267 of file team.hpp.

References info_, and team::team_info::proxy_controller.

◆ recall_cost()

int team::recall_cost ( ) const
inline

◆ recall_list() [1/2]

recall_list_manager& team::recall_list ( )
inline

◆ recall_list() [2/2]

const recall_list_manager& team::recall_list ( ) const
inline

Definition at line 202 of file team.hpp.

References recall_list_.

◆ recruits()

const std::set<std::string>& team::recruits ( ) const
inline

◆ refog()

void team::refog ( )
inline

Definition at line 310 of file team.hpp.

References fog_, and shroud_map::reset().

Referenced by actions::recalculate_fog().

◆ remove_fog_override()

void team::remove_fog_override ( const std::set< map_location > &  hexes)

Removes the record of hexes that were cleared of fog via WML.

Parameters
[in]hexesThe hexes to no longer keep clear.

Definition at line 744 of file team.cpp.

References fog_clearer_.

◆ reset_objectives_changed()

void team::reset_objectives_changed ( ) const
inline

Definition at line 224 of file team.hpp.

References info_, and team::team_info::objectives_changed.

◆ reshroud()

void team::reshroud ( )
inline

Definition at line 309 of file team.hpp.

References shroud_map::reset(), and shroud_.

◆ save_id()

const std::string& team::save_id ( ) const
inline

◆ save_id_or_number()

std::string team::save_id_or_number ( ) const
inline

◆ set_action_bonus_count()

void team::set_action_bonus_count ( const int  count)
inline

◆ set_auto_shroud_updates()

void team::set_auto_shroud_updates ( bool  value)
inline

Definition at line 325 of file team.hpp.

References auto_shroud_updates_.

Referenced by SYNCED_COMMAND_HANDLER_FUNCTION().

◆ set_base_income()

void team::set_base_income ( int  amount)
inline

Definition at line 195 of file team.hpp.

References game_config::base_income, team::team_info::income, and info_.

◆ set_carryover_add()

void team::set_carryover_add ( bool  value)
inline

Definition at line 342 of file team.hpp.

References team::team_info::carryover_add, and info_.

◆ set_carryover_bonus()

void team::set_carryover_bonus ( double  value)
inline

Definition at line 344 of file team.hpp.

References team::team_info::carryover_bonus, and info_.

◆ set_carryover_gold()

void team::set_carryover_gold ( int  value)
inline

Definition at line 346 of file team.hpp.

References team::team_info::carryover_gold, and info_.

◆ set_carryover_percentage()

void team::set_carryover_percentage ( int  value)
inline

Definition at line 340 of file team.hpp.

References team::team_info::carryover_percentage, and info_.

◆ set_color()

void team::set_color ( const std::string &  color)
inline
Note
Call display::reinit_flag_for_side() after calling this

Definition at line 244 of file team.hpp.

References team::team_info::color, color(), and info_.

Referenced by game_lua_kernel::intf_set_side_id().

◆ set_countdown_time()

void team::set_countdown_time ( const int  amount) const
inline

◆ set_current_player()

void team::set_current_player ( const std::string &  player)
inline

◆ set_defeat_condition()

void team::set_defeat_condition ( defeat_condition::type  value)
inline

Definition at line 329 of file team.hpp.

References team::team_info::defeat_cond, and info_.

◆ set_defeat_condition_string()

void team::set_defeat_condition_string ( const std::string &  value)
inline

sets the defeat condition if

Parameters
valueis a valid defeat condition, otherwise nothing happes.

Definition at line 331 of file team.hpp.

References team::team_info::defeat_cond, string_enums::enum_base< Definition >::get_enum(), and info_.

◆ set_flag()

void team::set_flag ( const std::string &  flag)
inline
Note
Call display::reinit_flag_for_side() after calling this

Definition at line 290 of file team.hpp.

References team::team_info::flag, flag(), and info_.

Referenced by game_lua_kernel::intf_set_side_id().

◆ set_flag_icon()

void team::set_flag_icon ( const std::string &  flag_icon)
inline

Definition at line 291 of file team.hpp.

References team::team_info::flag_icon, flag_icon(), and info_.

◆ set_fog()

void team::set_fog ( bool  fog)
inline

Definition at line 312 of file team.hpp.

References fog_, and shroud_map::set_enabled().

Referenced by SYNCED_COMMAND_HANDLER_FUNCTION().

◆ set_gold()

void team::set_gold ( int  amount)
inline

Definition at line 192 of file team.hpp.

References gold_.

◆ set_hidden()

void team::set_hidden ( bool  value)
inline

Definition at line 334 of file team.hpp.

References team::team_info::hidden, and info_.

◆ set_local()

void team::set_local ( bool  local)
inline

◆ set_lost()

void team::set_lost ( bool  value = true)
inline

Definition at line 337 of file team.hpp.

References info_, and team::team_info::lost.

◆ set_no_turn_confirmation()

void team::set_no_turn_confirmation ( bool  value)
inline

Definition at line 352 of file team.hpp.

References info_, and team::team_info::no_turn_confirmation.

◆ set_objectives()

void team::set_objectives ( const t_string new_objectives,
bool  silently = false 
)

◆ set_objectives_changed()

void team::set_objectives_changed ( bool  c = true) const
inline

Definition at line 223 of file team.hpp.

References c, info_, and team::team_info::objectives_changed.

◆ set_persistent()

void team::set_persistent ( bool  value)
inline

Definition at line 336 of file team.hpp.

References info_, and team::team_info::persistent.

◆ set_recall_cost()

void team::set_recall_cost ( int  cost)
inline

Definition at line 181 of file team.hpp.

References info_, and team::team_info::recall_cost.

◆ set_recruits()

void team::set_recruits ( const std::set< std::string > &  recruits)

◆ set_save_id()

void team::set_save_id ( const std::string &  save_id)
inline

Definition at line 219 of file team.hpp.

References info_, team::team_info::save_id, and save_id().

◆ set_scroll_to_leader()

void team::set_scroll_to_leader ( bool  value)
inline

Definition at line 207 of file team.hpp.

References info_, and team::team_info::scroll_to_leader.

◆ set_share_vision() [1/2]

void team::set_share_vision ( const std::string &  vision_status)
inline

◆ set_share_vision() [2/2]

void team::set_share_vision ( team_shared_vision::type  vision_status)
inline

Definition at line 384 of file team.hpp.

References clear_caches(), info_, and team::team_info::share_vision.

◆ set_shroud()

void team::set_shroud ( bool  shroud)
inline

Definition at line 311 of file team.hpp.

References shroud_map::set_enabled(), and shroud_.

Referenced by SYNCED_COMMAND_HANDLER_FUNCTION().

◆ set_side_name()

void team::set_side_name ( const t_string new_name)
inline

Definition at line 295 of file team.hpp.

References team::team_info::current_player, info_, and team::team_info::side_name.

◆ set_start_gold()

void team::set_start_gold ( const int  amount)
inline

Definition at line 193 of file team.hpp.

References info_, and team::team_info::start_gold.

◆ set_village_gold()

void team::set_village_gold ( int  income)
inline

Definition at line 180 of file team.hpp.

References team::team_info::income_per_village, and info_.

◆ set_village_support()

void team::set_village_support ( int  support)
inline
Parameters
supportThe number of unit levels each village can support

Definition at line 187 of file team.hpp.

References info_, support(), and team::team_info::support_per_village.

◆ share_maps()

bool team::share_maps ( ) const
inline

Definition at line 375 of file team.hpp.

References info_, and team::team_info::share_vision.

Referenced by ally_shroud(), and knows_about_team().

◆ share_view()

bool team::share_view ( ) const
inline

Definition at line 376 of file team.hpp.

References info_, and team::team_info::share_vision.

Referenced by ally_fog(), ally_shroud(), and knows_about_team().

◆ share_vision()

team_shared_vision::type team::share_vision ( ) const
inline

◆ shroud_data()

std::string team::shroud_data ( ) const
inline

Definition at line 313 of file team.hpp.

References shroud_, and shroud_map::write().

Referenced by merge_shroud_map_data().

◆ shrouded()

bool team::shrouded ( const map_location loc) const

◆ side()

int team::side ( ) const
inline

◆ side_name()

const std::string& team::side_name ( ) const
inline

◆ side_name_tstr()

t_string team::side_name_tstr ( ) const
inline

◆ spend_gold()

void team::spend_gold ( const int  amount)
inline

◆ start_gold()

int team::start_gold ( ) const
inline

◆ support()

int team::support ( ) const
inline

Calculate total support capacity, based on support_per_village.

Definition at line 189 of file team.hpp.

References village_support(), and villages_.

Referenced by play_controller::do_init_side(), and set_village_support().

◆ team_name()

const std::string& team::team_name ( ) const
inline

◆ to_config()

config team::to_config ( ) const

◆ toggle_droid()

void team::toggle_droid ( )
inline

Definition at line 279 of file team.hpp.

References info_, and team::team_info::proxy_controller.

◆ toggle_idle()

void team::toggle_idle ( )
inline

Definition at line 280 of file team.hpp.

References info_, and team::team_info::proxy_controller.

◆ total_income()

int team::total_income ( ) const
inline

◆ user_team_name()

const t_string& team::user_team_name ( ) const
inline

◆ uses_fog()

bool team::uses_fog ( ) const
inline

◆ uses_shroud()

bool team::uses_shroud ( ) const
inline

◆ variables() [1/2]

config& team::variables ( )
inline

◆ variables() [2/2]

const config& team::variables ( ) const
inline

Definition at line 349 of file team.hpp.

References info_, and team::team_info::variables.

◆ village_gold()

int team::village_gold ( ) const
inline

◆ village_support()

int team::village_support ( ) const
inline
Returns
The number of unit levels each village can support, i.e. how much upkeep each village can bear.

Definition at line 185 of file team.hpp.

References info_, and team::team_info::support_per_village.

Referenced by wfl::team_callable::get_value(), gui2::dialogs::game_stats::pre_show(), team::team_info::read(), and support().

◆ villages()

const std::set<map_location>& team::villages ( ) const
inline

◆ write()

void team::write ( config cfg) const

Member Data Documentation

◆ action_bonus_count_

int team::action_bonus_count_
private

Definition at line 417 of file team.hpp.

Referenced by action_bonus_count(), build(), set_action_bonus_count(), and write().

◆ ally_fog_

std::vector<const shroud_map*> team::ally_fog_
private

Definition at line 427 of file team.hpp.

Referenced by ally_fog().

◆ ally_shroud_

std::vector<const shroud_map*> team::ally_shroud_
mutableprivate

Definition at line 427 of file team.hpp.

Referenced by ally_shroud().

◆ attributes

const std::set< std::string > team::attributes
static

Stores the attributes recognized by [side].

These should be stripped from a side's config before using it to create the side's leader.

Definition at line 154 of file team.hpp.

Referenced by team_builder::handle_leader().

◆ auto_shroud_updates_

bool team::auto_shroud_updates_
private

Definition at line 412 of file team.hpp.

Referenced by auto_shroud_updates(), build(), set_auto_shroud_updates(), and write().

◆ countdown_time_

int team::countdown_time_
mutableprivate

Definition at line 416 of file team.hpp.

Referenced by build(), countdown_time(), set_countdown_time(), and write().

◆ default_team_gold_

const int team::default_team_gold_ = 100
staticprivate

Definition at line 144 of file team.hpp.

Referenced by team::team_info::read().

◆ enemies_

boost::dynamic_bitset team::enemies_
mutableprivate

Definition at line 425 of file team.hpp.

Referenced by calculate_enemies(), and is_enemy().

◆ fog_

shroud_map team::fog_
private

Definition at line 408 of file team.hpp.

Referenced by ally_fog(), build(), clear_fog(), fogged(), refog(), set_fog(), uses_fog(), and write().

◆ fog_clearer_

std::set<map_location> team::fog_clearer_
private

Stores hexes that have been cleared of fog via WML.

Definition at line 410 of file team.hpp.

Referenced by add_fog_override(), build(), fogged(), remove_fog_override(), and write().

◆ gold_

int team::gold_
private

Definition at line 405 of file team.hpp.

Referenced by build(), gold(), new_turn(), set_gold(), spend_gold(), and write().

◆ info_

team_info team::info_
private

Definition at line 414 of file team.hpp.

Referenced by add_recruit(), base_income(), build(), calculate_is_enemy(), carryover_add(), carryover_bonus(), carryover_gold(), carryover_percentage(), change_controller(), change_proxy(), change_team(), chose_random(), color(), controller(), current_player(), defeat_cond(), faction(), faction_name(), flag(), flag_icon(), get_disallow_observers(), get_scroll_to_leader(), handle_legacy_share_vision(), have_leader(), hidden(), is_ai(), is_droid(), is_empty(), is_human(), is_idle(), is_local(), is_network(), is_proxy_human(), log_recruitable(), lost(), make_ai(), make_droid(), make_human(), make_idle(), make_proxy_human(), minimum_recruit_price(), no_leader(), no_turn_confirmation(), objectives(), objectives_changed(), persistent(), proxy_controller(), recall_cost(), recruits(), reset_objectives_changed(), save_id(), save_id_or_number(), set_base_income(), set_carryover_add(), set_carryover_bonus(), set_carryover_gold(), set_carryover_percentage(), set_color(), set_current_player(), set_defeat_condition(), set_defeat_condition_string(), set_flag(), set_flag_icon(), set_hidden(), set_local(), set_lost(), set_no_turn_confirmation(), set_objectives(), set_objectives_changed(), set_persistent(), set_recall_cost(), set_recruits(), set_save_id(), set_scroll_to_leader(), set_share_vision(), set_side_name(), set_start_gold(), set_village_gold(), set_village_support(), share_maps(), share_view(), share_vision(), side(), side_name(), side_name_tstr(), start_gold(), team_name(), toggle_droid(), toggle_idle(), total_income(), user_team_name(), variables(), village_gold(), village_support(), and write().

◆ last_recruit_

std::string team::last_recruit_
private

Definition at line 420 of file team.hpp.

Referenced by last_recruit().

◆ planned_actions_

std::shared_ptr<wb::side_actions> team::planned_actions_
private

Whiteboard planned actions for this team.

Definition at line 432 of file team.hpp.

Referenced by build(), and get_side_actions().

◆ recall_list_

recall_list_manager team::recall_list_
private

Definition at line 419 of file team.hpp.

Referenced by recall_list().

◆ shroud_

shroud_map team::shroud_
private

◆ villages_

std::set<map_location> team::villages_
private

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