The Battle for Wesnoth  1.15.0+dev
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | 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

class  shroud_map
 
struct  team_info
 

Public Member Functions

 MAKE_ENUM (CONTROLLER,(HUMAN, "human")(AI, "ai")(EMPTY, "null")) MAKE_ENUM(PROXY_CONTROLLER
 
 human (PROXY_AI, "ai")(PROXY_IDLE
 
idle MAKE_ENUM (DEFEAT_CONDITION,(NO_LEADER, "no_leader_left")(NO_UNITS, "no_units_left")(NEVER, "never")(ALWAYS, "always")) MAKE_ENUM(SHARE_VISION
 
idle all (SHROUD, "shroud")(NONE
 
 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. 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. 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
 
CONTROLLER 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 (CONTROLLER controller)
 
void change_controller_by_wml (const std::string &new_controller)
 
PROXY_CONTROLLER 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 (PROXY_CONTROLLER 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)
 
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 defeat_condition () const
 
void set_defeat_condition (DEFEAT_CONDITION 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
 
SHARE_VISION share_vision () const
 
void set_share_vision (const std::string &vision_status)
 
void set_share_vision (SHARE_VISION 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 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...
 

Public Attributes

 PROXY_HUMAN
 
idle ALL
 

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 44 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 332 of file team.hpp.

Referenced by game_lua_kernel::intf_toggle_fog().

◆ add_recruit()

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

◆ all()

idle team::all ( SHROUD  ,
"shroud"   
)

◆ allied_human_teams()

std::string team::allied_human_teams ( ) const

Definition at line 1022 of file team.cpp.

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

◆ ally_fog()

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

Definition at line 684 of file team.cpp.

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

Referenced by fogged().

◆ ally_shroud()

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

Definition at line 671 of file team.cpp.

References ally_shroud_, i, is_enemy(), 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 506 of file team.cpp.

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

◆ calculate_is_enemy()

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

◆ carryover_add()

bool team::carryover_add ( ) const
inline

Definition at line 355 of file team.hpp.

Referenced by impl_side_get(), and campaign_controller::report_victory().

◆ carryover_bonus()

double team::carryover_bonus ( ) const
inline

Definition at line 357 of file team.hpp.

Referenced by impl_side_get(), and campaign_controller::report_victory().

◆ carryover_gold()

int team::carryover_gold ( ) const
inline

Definition at line 359 of file team.hpp.

Referenced by campaign_controller::report_victory().

◆ carryover_percentage()

int team::carryover_percentage ( ) const
inline

Definition at line 353 of file team.hpp.

Referenced by impl_side_get(), and campaign_controller::report_victory().

◆ change_controller() [1/2]

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

◆ change_controller() [2/2]

void team::change_controller ( CONTROLLER  controller)
inline

Definition at line 278 of file team.hpp.

◆ change_controller_by_wml()

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

◆ change_proxy()

void team::change_proxy ( PROXY_CONTROLLER  proxy)
inline

Definition at line 291 of file team.hpp.

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 407 of file team.hpp.

Referenced by impl_side_get().

◆ clear_caches()

void team::clear_caches ( )
static

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

Definition at line 623 of file team.cpp.

References resources::gameboard, and t.

Referenced by change_team().

◆ clear_fog()

bool team::clear_fog ( const map_location loc)
inline

◆ clear_proxy()

void team::clear_proxy ( )
inline

Definition at line 289 of file team.hpp.

◆ clear_shroud()

bool team::clear_shroud ( const map_location loc)
inline

Definition at line 319 of file team.hpp.

References map_location::wml_x(), and map_location::wml_y().

Referenced by actions::shroud_clearer::clear_loc().

◆ clear_villages()

void team::clear_villages ( )
inline

Definition at line 183 of file team.hpp.

◆ color()

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

◆ controller()

CONTROLLER team::controller ( ) const
inline

◆ countdown_time()

int team::countdown_time ( ) const
inline

◆ current_player()

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

◆ defeat_condition()

DEFEAT_CONDITION team::defeat_condition ( ) const
inline

◆ faction()

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

Definition at line 309 of file team.hpp.

Referenced by impl_side_get().

◆ faction_name()

const t_string& team::faction_name ( ) const
inline

Definition at line 310 of file team.hpp.

Referenced by impl_side_get().

◆ fix_villages()

void team::fix_villages ( const gamemap map)

Definition at line 425 of file team.cpp.

References gamemap::is_village(), and villages_.

◆ flag()

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

Definition at line 300 of file team.hpp.

Referenced by impl_side_get().

◆ flag_icon()

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

Definition at line 301 of file team.hpp.

Referenced by impl_side_get(), REPORT_GENERATOR(), and unit_side().

◆ 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 338 of file team.hpp.

Referenced by play_controller::is_team_visible().

◆ get_minimap_color()

color_t team::get_minimap_color ( int  side)
static

Definition at line 945 of file team.cpp.

References get_side_color_range(), and color_range::rep().

Referenced by display::draw_minimap_units(), and image::getMinimap().

◆ get_scroll_to_leader()

bool team::get_scroll_to_leader ( ) const
inline

Definition at line 220 of file team.hpp.

Referenced by impl_side_get().

◆ 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_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 437 of file team.cpp.

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

Referenced by actions::get_village(), ai::helper_check_village(), and 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 401 of file team.hpp.

◆ have_leader()

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

Definition at line 344 of file team.hpp.

Referenced by editor::map_context::set_side_setup().

◆ hidden()

bool team::hidden ( ) const
inline

◆ human()

team::human ( PROXY_AI  ,
"ai"   
)

◆ is_ai()

bool team::is_ai ( ) const
inline

Definition at line 264 of file team.hpp.

◆ is_droid()

bool team::is_droid ( ) const
inline

Definition at line 283 of file team.hpp.

◆ is_empty()

bool team::is_empty ( ) const
inline

◆ is_enemy()

bool team::is_enemy ( int  n) const
inline

Definition at line 243 of file team.hpp.

References utf8::index().

Referenced by ai::protect_goal::add_targets(), ally_fog(), ally_shroud(), ai::attack_analysis::analyze(), ai::ai_default_rca::aspect_attacks_base::analyze_targets(), attack_info(), ai::readonly_context_impl::calculate_moves(), ai::ai_default_rca::move_to_targets_phase::choose_move(), actions::shroud_clearer::clear_loc(), wfl::attack_map_callable::collect_possible_attacks(), ai::default_ai_context_impl::count_free_hexes_in_castle(), create_jamming_map(), events::mouse_handler::current_unit_attacks_from(), ai::ai_default_rca::aspect_attacks_base::do_attack_analysis(), ai::default_recruitment::recruitment::do_combat_analysis(), play_controller::enemies_visible(), pathfind::enemy_zoc(), wfl::attack_candidate_action::evaluate(), pathfind::find_routes(), ai::default_ai_context_impl::find_targets(), events::mouse_handler::get_adj_enemies(), display::get_flag(), ai::default_recruitment::recruitment::get_unit_ratio(), ai::formula_ai::get_value(), actions::get_village(), image::getMinimap(), ai::helper_check_village(), ai::ai_default_rca::aspect_attacks::is_allowed_enemy(), ai::default_recruitment::recruitment::is_enemy_in_radius(), unit::is_visible_to_team(), knows_about_team(), pathfind::mark_route(), side_filter::match_internal(), wb::manager::on_change_controller(), gui2::dialogs::game_stats::pre_show(), unit_drawer::redraw_unit(), REPORT_GENERATOR(), events::mouse_handler::show_attack_options(), events::menu_handler::show_enemy_moves(), pathfind::teleport_map::teleport_map(), display_context::unit_can_move(), events::mouse_handler::unit_in_cycle(), and display_context::would_be_discovered().

◆ is_human()

bool team::is_human ( ) const
inline

Definition at line 263 of file team.hpp.

Referenced by knows_about_team(), and game_board::side_change_controller().

◆ is_idle()

bool team::is_idle ( ) const
inline

◆ 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

◆ is_network_human()

bool team::is_network_human ( ) const
inline

Definition at line 268 of file team.hpp.

◆ is_proxy_human()

bool team::is_proxy_human ( ) const
inline

Definition at line 282 of file team.hpp.

Referenced by play_controller::is_browsing().

◆ 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

◆ last_recruit() [2/2]

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

Definition at line 229 of file team.hpp.

◆ log_recruitable()

void team::log_recruitable ( ) const

Definition at line 1004 of file team.cpp.

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

◆ lose_village()

void team::lose_village ( const map_location loc)

Definition at line 463 of file team.cpp.

References villages_.

Referenced by game_lua_kernel::intf_set_village_owner().

◆ lost()

bool team::lost ( ) const
inline

Definition at line 350 of file team.hpp.

Referenced by impl_side_get().

◆ make_ai()

void team::make_ai ( )
inline

Definition at line 273 of file team.hpp.

Referenced by playsingle_controller::sync_end_turn().

◆ make_droid()

void team::make_droid ( )
inline

Definition at line 286 of file team.hpp.

◆ MAKE_ENUM() [1/2]

team::MAKE_ENUM ( CONTROLLER  ,
(HUMAN, "human")(AI, "ai")(EMPTY, "null")   
)

◆ MAKE_ENUM() [2/2]

idle team::MAKE_ENUM ( DEFEAT_CONDITION  ,
(NO_LEADER, "no_leader_left")(NO_UNITS, "no_units_left")(NEVER, "never")(ALWAYS, "always")   
)

◆ make_human()

void team::make_human ( )
inline

Definition at line 272 of file team.hpp.

Referenced by playsingle_controller::play_ai_turn().

◆ make_idle()

void team::make_idle ( )
inline

Definition at line 287 of file team.hpp.

◆ make_proxy_human()

void team::make_proxy_human ( )
inline

Definition at line 288 of file team.hpp.

◆ 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 328 of file team.hpp.

References utf8::index().

Referenced by game_lua_kernel::intf_shroud_op().

◆ minimum_recruit_price()

int team::minimum_recruit_price ( ) const

◆ new_turn()

void team::new_turn ( )
inline

Definition at line 204 of file team.hpp.

Referenced by play_controller::do_init_side().

◆ no_leader()

bool team::no_leader ( ) const
inline

Definition at line 339 of file team.hpp.

◆ no_turn_confirmation()

bool team::no_turn_confirmation ( ) const
inline

Definition at line 363 of file team.hpp.

Referenced by impl_side_get().

◆ objectives()

const t_string& team::objectives ( ) const
inline

◆ objectives_changed()

bool team::objectives_changed ( ) const
inline

Definition at line 241 of file team.hpp.

Referenced by playsingle_controller::check_objectives(), and impl_side_get().

◆ owns_village()

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

◆ persistent()

bool team::persistent ( ) const
inline

Definition at line 347 of file team.hpp.

Referenced by impl_side_get().

◆ place_shroud()

void team::place_shroud ( const map_location loc)
inline

Definition at line 320 of file team.hpp.

References map_location::wml_x(), and map_location::wml_y().

◆ proxy_controller()

PROXY_CONTROLLER team::proxy_controller ( ) const
inline

Definition at line 281 of file team.hpp.

Referenced by playsingle_controller::play_side_impl().

◆ 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 216 of file team.hpp.

◆ recruits()

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

◆ refog()

void team::refog ( )
inline

Definition at line 323 of file team.hpp.

Referenced by game_lua_kernel::intf_toggle_fog(), and 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 738 of file team.cpp.

References fog_clearer_.

Referenced by game_lua_kernel::intf_toggle_fog().

◆ reset_objectives_changed()

void team::reset_objectives_changed ( ) const
inline

Definition at line 238 of file team.hpp.

Referenced by play_controller::show_objectives().

◆ reshroud()

void team::reshroud ( )
inline

Definition at line 322 of file team.hpp.

Referenced by game_lua_kernel::intf_shroud_op().

◆ save_id()

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

Definition at line 231 of file team.hpp.

Referenced by impl_side_get(), and events::save_id_matches::operator()().

◆ 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 337 of file team.hpp.

Referenced by SYNCED_COMMAND_HANDLER_FUNCTION().

◆ set_base_income()

void team::set_base_income ( int  amount)
inline

Definition at line 209 of file team.hpp.

References game_config::base_income.

Referenced by impl_side_set(), and editor::map_context::set_side_setup().

◆ set_carryover_add()

void team::set_carryover_add ( bool  value)
inline

Definition at line 354 of file team.hpp.

Referenced by impl_side_set().

◆ set_carryover_bonus()

void team::set_carryover_bonus ( double  value)
inline

Definition at line 356 of file team.hpp.

Referenced by impl_side_set().

◆ set_carryover_gold()

void team::set_carryover_gold ( int  value)
inline

Definition at line 358 of file team.hpp.

◆ set_carryover_percentage()

void team::set_carryover_percentage ( int  value)
inline

Definition at line 352 of file team.hpp.

Referenced by impl_side_set().

◆ set_color()

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

Definition at line 257 of file team.hpp.

Referenced by impl_side_set(), and 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

Definition at line 217 of file team.hpp.

Referenced by game_board::side_change_controller(), and game_board::side_drop_to().

◆ set_defeat_condition()

void team::set_defeat_condition ( DEFEAT_CONDITION  value)
inline

Definition at line 341 of file team.hpp.

◆ 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 343 of file team.hpp.

Referenced by impl_side_set().

◆ set_flag()

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

Definition at line 303 of file team.hpp.

References game_config::images::flag.

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 304 of file team.hpp.

References game_config::images::flag_icon.

Referenced by impl_side_set().

◆ set_fog()

void team::set_fog ( bool  fog)
inline

◆ set_gold()

void team::set_gold ( int  amount)
inline

Definition at line 206 of file team.hpp.

Referenced by impl_side_set(), and editor::map_context::set_side_setup().

◆ set_hidden()

void team::set_hidden ( bool  value)
inline

Definition at line 346 of file team.hpp.

Referenced by impl_side_set(), and editor::map_context::set_side_setup().

◆ set_local()

void team::set_local ( bool  local)
inline

◆ set_lost()

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

Definition at line 349 of file team.hpp.

Referenced by impl_side_set().

◆ set_no_turn_confirmation()

void team::set_no_turn_confirmation ( bool  value)
inline

Definition at line 364 of file team.hpp.

Referenced by impl_side_set().

◆ 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 237 of file team.hpp.

References c.

Referenced by impl_side_set().

◆ set_persistent()

void team::set_persistent ( bool  value)
inline

Definition at line 348 of file team.hpp.

Referenced by impl_side_set().

◆ set_recall_cost()

void team::set_recall_cost ( int  cost)
inline

Definition at line 195 of file team.hpp.

Referenced by impl_side_set().

◆ 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 233 of file team.hpp.

◆ set_scroll_to_leader()

void team::set_scroll_to_leader ( bool  value)
inline

Definition at line 221 of file team.hpp.

Referenced by impl_side_set().

◆ set_share_vision() [1/2]

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

Definition at line 390 of file team.hpp.

Referenced by impl_side_set(), and editor::map_context::set_side_setup().

◆ set_share_vision() [2/2]

void team::set_share_vision ( SHARE_VISION  vision_status)
inline

Definition at line 396 of file team.hpp.

◆ set_shroud()

void team::set_shroud ( bool  shroud)
inline

◆ set_side_name()

void team::set_side_name ( const t_string new_name)
inline

Definition at line 308 of file team.hpp.

Referenced by impl_side_set().

◆ set_start_gold()

void team::set_start_gold ( const int  amount)
inline

Definition at line 207 of file team.hpp.

◆ set_village_gold()

void team::set_village_gold ( int  income)
inline

Definition at line 194 of file team.hpp.

Referenced by impl_side_set(), and editor::map_context::set_side_setup().

◆ set_village_support()

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

Definition at line 201 of file team.hpp.

Referenced by impl_side_set(), and editor::map_context::set_side_setup().

◆ share_maps()

bool team::share_maps ( ) const
inline

Definition at line 386 of file team.hpp.

References gui2::NONE.

Referenced by impl_side_get(), and knows_about_team().

◆ share_view()

bool team::share_view ( ) const
inline

Definition at line 387 of file team.hpp.

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

◆ share_vision()

SHARE_VISION team::share_vision ( ) const
inline

Definition at line 388 of file team.hpp.

Referenced by impl_side_get().

◆ 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

Definition at line 307 of file team.hpp.

References t_string::empty().

Referenced by impl_side_get().

◆ spend_gold()

void team::spend_gold ( const int  amount)
inline

◆ start_gold()

int team::start_gold ( ) const
inline

Definition at line 190 of file team.hpp.

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

◆ support()

int team::support ( ) const
inline

Calculate total support capacity, based on support_per_village.

Definition at line 203 of file team.hpp.

References game_config::village_support.

Referenced by play_controller::do_init_side().

◆ 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 293 of file team.hpp.

◆ toggle_idle()

void team::toggle_idle ( )
inline

Definition at line 294 of file team.hpp.

◆ total_income()

int team::total_income ( ) const
inline

Definition at line 196 of file team.hpp.

References game_config::base_income.

Referenced by impl_side_get(), and ai_testing::log_turn().

◆ 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

Definition at line 360 of file team.hpp.

◆ variables() [2/2]

const config& team::variables ( ) const
inline

Definition at line 361 of file team.hpp.

◆ village_gold()

int team::village_gold ( ) const
inline

Definition at line 192 of file team.hpp.

Referenced by impl_side_get(), and gui2::dialogs::game_stats::pre_show().

◆ 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 199 of file team.hpp.

Referenced by impl_side_get(), gui2::dialogs::game_stats::pre_show(), and team::team_info::read().

◆ 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 429 of file team.hpp.

Referenced by build(), and write().

◆ ALL

idle team::ALL

Definition at line 68 of file team.hpp.

◆ ally_fog_

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

Definition at line 439 of file team.hpp.

Referenced by ally_fog().

◆ ally_shroud_

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

Definition at line 439 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 174 of file team.hpp.

Referenced by team_builder::handle_leader().

◆ auto_shroud_updates_

bool team::auto_shroud_updates_
private

Definition at line 424 of file team.hpp.

Referenced by build(), and write().

◆ countdown_time_

int team::countdown_time_
mutableprivate

Definition at line 428 of file team.hpp.

Referenced by build(), and write().

◆ default_team_gold_

const int team::default_team_gold_ = 100
staticprivate

Definition at line 166 of file team.hpp.

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

◆ enemies_

boost::dynamic_bitset team::enemies_
mutableprivate

Definition at line 437 of file team.hpp.

Referenced by calculate_enemies().

◆ fog_

shroud_map team::fog_
private

Definition at line 420 of file team.hpp.

Referenced by ally_fog(), build(), fogged(), 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 422 of file team.hpp.

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

◆ gold_

int team::gold_
private

Definition at line 417 of file team.hpp.

Referenced by build(), and write().

◆ info_

team_info team::info_
private

◆ last_recruit_

std::string team::last_recruit_
private

Definition at line 432 of file team.hpp.

◆ planned_actions_

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

Whiteboard planned actions for this team.

Definition at line 444 of file team.hpp.

Referenced by build().

◆ PROXY_HUMAN

team::PROXY_HUMAN

Definition at line 55 of file team.hpp.

◆ recall_list_

recall_list_manager team::recall_list_
private

Definition at line 431 of file team.hpp.

◆ shroud_

shroud_map team::shroud_
private

Definition at line 420 of file team.hpp.

Referenced by ally_shroud(), build(), shrouded(), and write().

◆ villages_

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

Definition at line 418 of file team.hpp.

Referenced by build(), fix_villages(), get_village(), lose_village(), and write().


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