The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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
 
bool 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::stringlast_recruit () const
 
void last_recruit (const std::string &u_type)
 
const std::stringsave_id () const
 
void set_save_id (const std::string &save_id)
 
const std::stringcurrent_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::stringcolor () 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::stringteam_name () const
 
const t_stringuser_team_name () const
 
void change_team (const std::string &name, const t_string &user_name)
 
const std::stringflag () const
 
const std::stringflag_icon () const
 
void set_flag (const std::string &flag)
 
void set_flag_icon (const std::string &flag_icon)
 
const std::stringside_name () const
 
const std::stringfaction () 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 (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
 
boost::shared_ptr
< wb::side_actions
get_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
 

Static Public Member Functions

static const color_range get_side_color_range (int side)
 
static Uint32 get_side_rgb (int side)
 
static Uint32 get_side_rgb_max (int side)
 
static Uint32 get_side_rgb_min (int side)
 
static SDL_Color get_side_color (int side)
 
static SDL_Color get_minimap_color (int side)
 
static std::string get_side_color_index (int side)
 
static std::string get_side_highlight (int side)
 
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
boost::container::flat_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
 
bool calculate_enemies (size_t index) const
 
bool calculate_is_enemy (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_
 
std::vector< bool > enemies_
 
std::vector< const shroud_map * > ally_shroud_
 
std::vector< const shroud_map * > ally_fog_
 
boost::shared_ptr
< wb::side_actions
planned_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 50 of file team.hpp.

Constructor & Destructor Documentation

team::team ( )

Definition at line 283 of file team.cpp.

team::~team ( )
virtual

Definition at line 302 of file team.cpp.

Member Function Documentation

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

Records hexes that were cleared of fog via WML.

Definition at line 331 of file team.hpp.

References fog_clearer_.

Referenced by game_lua_kernel::intf_toggle_fog().

void team::add_recruit ( const std::string recruit)
idle team::all ( SHROUD  ,
"shroud"   
)
std::string team::allied_human_teams ( ) const

Definition at line 880 of file team.cpp.

References utils::join().

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

Definition at line 602 of file team.cpp.

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

Referenced by fogged().

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

Definition at line 589 of file team.cpp.

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

Referenced by shrouded().

bool team::auto_shroud_updates ( ) const
inline
int team::base_income ( ) const
inline
void team::build ( const config cfg,
const gamemap map,
int  gold = default_team_gold_ 
)
bool team::calculate_enemies ( size_t  index) const
private

Definition at line 441 of file team.cpp.

References calculate_is_enemy(), and enemies_.

Referenced by is_enemy().

bool team::calculate_is_enemy ( size_t  index) const
private
bool team::carryover_add ( ) const
inline
double team::carryover_bonus ( ) const
inline
int team::carryover_gold ( ) const
inline
int team::carryover_percentage ( ) const
inline
void team::change_controller ( const std::string new_controller)
inline
void team::change_controller ( CONTROLLER  controller)
inline

Definition at line 279 of file team.hpp.

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

void team::change_controller_by_wml ( const std::string new_controller)
void team::change_proxy ( PROXY_CONTROLLER  proxy)
inline

Definition at line 292 of file team.hpp.

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

Referenced by game_board::side_drop_to().

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

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

Definition at line 549 of file team.cpp.

References i.

Referenced by change_team().

bool team::clear_fog ( const map_location loc)
inline
void team::clear_proxy ( )
inline

Definition at line 290 of file team.hpp.

References make_proxy_human().

bool team::clear_shroud ( const map_location loc)
inline
void team::clear_villages ( )
inline

Definition at line 188 of file team.hpp.

References villages_.

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

Definition at line 257 of file team.hpp.

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

Referenced by impl_side_get(), set_color(), and team::team_info::write().

CONTROLLER team::controller ( ) const
inline
int team::countdown_time ( ) const
inline
const std::string& team::current_player ( ) const
inline
DEFEAT_CONDITION team::defeat_condition ( ) const
inline
const std::string& team::faction ( ) const
inline

Definition at line 308 of file team.hpp.

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

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

const t_string& team::faction_name ( ) const
inline

Definition at line 309 of file team.hpp.

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

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

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

Definition at line 301 of file team.hpp.

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

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

const std::string& team::flag_icon ( ) const
inline
bool team::fog_or_shroud ( ) const
inline
bool team::fogged ( const map_location loc) const
bool team::get_disallow_observers ( ) const
inline

Definition at line 337 of file team.hpp.

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

Referenced by play_controller::is_team_visible().

SDL_Color team::get_minimap_color ( int  side)
static

Definition at line 833 of file team.cpp.

References get_side_color_range(), and int_to_color().

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

bool team::get_scroll_to_leader ( ) const
inline

Definition at line 225 of file team.hpp.

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

Referenced by impl_side_get().

void team::get_shared_maps ( )
boost::shared_ptr<wb::side_actions> team::get_side_actions ( ) const
inline

get the whiteboard planned actions for this team

Definition at line 382 of file team.hpp.

References planned_actions_.

Referenced by wb::recall::execute(), wb::manager::on_change_controller(), wb::manager::process_network_data(), and wb::team_has_visible_plan().

SDL_Color team::get_side_color ( int  side)
static
std::string team::get_side_color_index ( int  side)
static
const color_range team::get_side_color_range ( int  side)
static
std::string team::get_side_highlight ( int  side)
static
std::string team::get_side_highlight_pango ( int  side)
static

Definition at line 858 of file team.cpp.

References get_side_color_range(), and rgb2highlight_pango().

Referenced by chat_msg::chat_msg().

static Uint32 team::get_side_rgb ( int  side)
inlinestatic

Definition at line 367 of file team.hpp.

References get_side_color_range().

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

static Uint32 team::get_side_rgb_max ( int  side)
inlinestatic

Definition at line 368 of file team.hpp.

References get_side_color_range().

static Uint32 team::get_side_rgb_min ( int  side)
inlinestatic

Definition at line 369 of file team.hpp.

References get_side_color_range().

bool 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 377 of file team.cpp.

References config::attribute_value::blank(), game_data::clear_variable(), game_events::t_pump::fire(), resources::game_events, game_data::get_variable(), game_events::manager::pump(), and villages_.

Referenced by actions::get_village(), and ai::helper_check_village().

int team::gold ( ) const
inline
void team::handle_legacy_share_vision ( const config cfg)
inline
void team::have_leader ( bool  value = true)
inline

Definition at line 343 of file team.hpp.

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

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

bool team::hidden ( ) const
inline
team::human ( PROXY_AI  ,
"ai"   
)
bool team::is_ai ( ) const
inline

Definition at line 265 of file team.hpp.

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

Referenced by is_local_ai(), and is_network_ai().

bool team::is_droid ( ) const
inline

Definition at line 284 of file team.hpp.

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

bool team::is_empty ( ) const
inline
bool team::is_enemy ( int  n) const
inline

Definition at line 247 of file team.hpp.

References calculate_enemies(), and enemies_.

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(), game_logic::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(), game_logic::attack_candidate_action::evaluate(), pathfind::find_routes(), ai::default_ai_context_impl::find_targets(), events::mouse_handler::get_adj_enemies(), ai::default_recruitment::recruitment::get_unit_ratio(), ai::formula_ai::get_value(), actions::get_village(), image::getMinimap(), ai::helper_check_village(), ai::default_recruitment::recruitment::is_enemy_in_radius(), unit::is_visible_to_team(), knows_about_team(), pathfind::mark_route(), wb::manager::on_change_controller(), unit_drawer::redraw_unit(), REPORT_GENERATOR(), events::mouse_handler::show_attack_options(), events::menu_handler::status_table(), pathfind::teleport_map::teleport_map(), display_context::unit_can_move(), and events::mouse_handler::unit_in_cycle().

bool team::is_human ( ) const
inline
bool team::is_idle ( ) const
inline

Definition at line 285 of file team.hpp.

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

Referenced by play_controller::is_team_visible().

bool team::is_local ( ) const
inline
bool team::is_local_ai ( ) const
inline

Definition at line 268 of file team.hpp.

References is_ai(), and is_local().

Referenced by wb::manager::on_change_controller(), and SYNCED_COMMAND_HANDLER_FUNCTION().

bool team::is_local_human ( ) const
inline
bool team::is_network ( ) const
inline
bool team::is_network_ai ( ) const
inline

Definition at line 270 of file team.hpp.

References is_ai(), and is_network().

Referenced by wb::manager::on_change_controller(), and SYNCED_COMMAND_HANDLER_FUNCTION().

bool team::is_network_human ( ) const
inline

Definition at line 269 of file team.hpp.

References is_human(), and is_network().

bool team::is_proxy_human ( ) const
inline

Definition at line 283 of file team.hpp.

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

Referenced by play_controller::is_browsing().

bool team::knows_about_team ( size_t  index) const
const std::string& team::last_recruit ( ) const
inline

Definition at line 233 of file team.hpp.

References last_recruit_.

Referenced by events::menu_handler::do_recruit(), and actions::undo::recruit_action::redo().

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

Definition at line 234 of file team.hpp.

References last_recruit_.

void team::log_recruitable ( ) const

Definition at line 863 of file team.cpp.

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

void team::lose_village ( const map_location loc)

Definition at line 399 of file team.cpp.

References villages_.

bool team::lost ( ) const
inline

Definition at line 349 of file team.hpp.

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

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

void team::make_ai ( )
inline

Definition at line 274 of file team.hpp.

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

void team::make_droid ( )
inline

Definition at line 287 of file team.hpp.

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

team::MAKE_ENUM ( CONTROLLER  ,
(HUMAN,"human")(AI,"ai")(EMPTY,"null")   
)
idle team::MAKE_ENUM ( DEFEAT_CONDITION  ,
(NO_LEADER,"no_leader_left")(NO_UNITS,"no_units_left")(NEVER,"never")(ALWAYS,"always")   
)
void team::make_human ( )
inline

Definition at line 273 of file team.hpp.

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

Referenced by playsingle_controller::play_ai_turn().

void team::make_idle ( )
inline

Definition at line 288 of file team.hpp.

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

void team::make_proxy_human ( )
inline

Definition at line 289 of file team.hpp.

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

Referenced by clear_proxy().

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

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

Referenced by game_lua_kernel::intf_modify_side().

int team::minimum_recruit_price ( ) const
void team::new_turn ( )
inline

Definition at line 209 of file team.hpp.

References gold_, and total_income().

Referenced by play_controller::do_init_side().

bool team::no_leader ( ) const
inline
bool team::no_turn_confirmation ( ) const
inline

Definition at line 362 of file team.hpp.

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

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

const t_string& team::objectives ( ) const
inline
bool team::objectives_changed ( ) const
inline
bool team::owns_village ( const map_location loc) const
inline
bool team::persistent ( ) const
inline

Definition at line 346 of file team.hpp.

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

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

void team::place_shroud ( const map_location loc)
inline
PROXY_CONTROLLER team::proxy_controller ( ) const
inline

Definition at line 282 of file team.hpp.

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

Referenced by playsingle_controller::play_side_impl().

int team::recall_cost ( ) const
inline
recall_list_manager& team::recall_list ( )
inline
const recall_list_manager& team::recall_list ( ) const
inline

Definition at line 221 of file team.hpp.

References recall_list_.

const std::set<std::string>& team::recruits ( ) const
inline
void team::refog ( )
inline
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 644 of file team.cpp.

References fog_clearer_.

Referenced by game_lua_kernel::intf_toggle_fog().

void team::reset_objectives_changed ( ) const
inline
void team::reshroud ( )
inline

Definition at line 321 of file team.hpp.

References team::shroud_map::reset(), and shroud_.

Referenced by game_lua_kernel::intf_modify_side().

const std::string& team::save_id ( ) const
inline
void team::set_action_bonus_count ( const int  count)
inline
void team::set_auto_shroud_updates ( bool  value)
inline

Definition at line 336 of file team.hpp.

References auto_shroud_updates_.

Referenced by SYNCED_COMMAND_HANDLER_FUNCTION().

void team::set_base_income ( int  amount)
inline
void team::set_carryover_add ( bool  value)
inline

Definition at line 353 of file team.hpp.

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

Referenced by impl_side_set().

void team::set_carryover_bonus ( double  value)
inline

Definition at line 355 of file team.hpp.

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

Referenced by impl_side_set().

void team::set_carryover_gold ( int  value)
inline

Definition at line 357 of file team.hpp.

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

void team::set_carryover_percentage ( int  value)
inline

Definition at line 351 of file team.hpp.

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

Referenced by impl_side_set().

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

Definition at line 258 of file team.hpp.

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

Referenced by impl_side_set(), and game_lua_kernel::intf_modify_side().

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

Definition at line 216 of file team.hpp.

References amount, and countdown_time_.

Referenced by playmp_controller::after_human_turn(), and countdown_clock::update_team().

void team::set_current_player ( const std::string player)
inline
void team::set_defeat_condition ( DEFEAT_CONDITION  value)
inline

Definition at line 340 of file team.hpp.

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

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

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

Referenced by impl_side_set(), and game_lua_kernel::intf_modify_side().

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

Definition at line 304 of file team.hpp.

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

Referenced by game_lua_kernel::intf_modify_side().

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

Definition at line 305 of file team.hpp.

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

Referenced by game_lua_kernel::intf_modify_side().

void team::set_fog ( bool  fog)
inline
void team::set_gold ( int  amount)
inline

Definition at line 211 of file team.hpp.

References amount, and gold_.

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

void team::set_hidden ( bool  value)
inline
void team::set_local ( bool  local)
inline
void team::set_lost ( bool  value = true)
inline

Definition at line 348 of file team.hpp.

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

Referenced by impl_side_set().

void team::set_no_turn_confirmation ( bool  value)
inline

Definition at line 363 of file team.hpp.

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

Referenced by game_lua_kernel::intf_modify_side().

void team::set_objectives ( const t_string new_objectives,
bool  silently = false 
)
void team::set_objectives_changed ( bool  c = true) const
inline

Definition at line 241 of file team.hpp.

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

Referenced by impl_side_set().

void team::set_persistent ( bool  value)
inline

Definition at line 347 of file team.hpp.

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

Referenced by impl_side_set().

void team::set_recall_cost ( int  cost)
inline

Definition at line 200 of file team.hpp.

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

Referenced by impl_side_set().

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

Definition at line 237 of file team.hpp.

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

void team::set_scroll_to_leader ( bool  value)
inline

Definition at line 226 of file team.hpp.

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

Referenced by impl_side_set(), and game_lua_kernel::intf_modify_side().

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

Definition at line 390 of file team.hpp.

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

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

void team::set_share_vision ( SHARE_VISION  vision_status)
inline

Definition at line 395 of file team.hpp.

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

void team::set_shroud ( bool  shroud)
inline
void team::set_start_gold ( const int  amount)
inline

Definition at line 212 of file team.hpp.

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

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

Definition at line 206 of file team.hpp.

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

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

bool team::share_maps ( ) const
inline

Definition at line 386 of file team.hpp.

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

Referenced by knows_about_team().

bool team::share_view ( ) const
inline

Definition at line 387 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::share_vision ( ) const
inline
bool team::shrouded ( const map_location loc) const
int team::side ( ) const
inline
const std::string& team::side_name ( ) const
inline
void team::spend_gold ( const int  amount)
inline
int team::start_gold ( ) const
inline

Definition at line 195 of file team.hpp.

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

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

int team::support ( ) const
inline

Calculate total support capacity, based on support_per_village.

Definition at line 208 of file team.hpp.

References village_support(), and villages_.

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

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

Definition at line 872 of file team.cpp.

References config::add_child(), and write().

void team::toggle_droid ( )
inline

Definition at line 294 of file team.hpp.

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

void team::toggle_idle ( )
inline

Definition at line 295 of file team.hpp.

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

int team::total_income ( ) const
inline
const t_string& team::user_team_name ( ) const
inline
bool team::uses_fog ( ) const
inline
bool team::uses_shroud ( ) const
inline
config& team::variables ( )
inline

Definition at line 359 of file team.hpp.

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

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

const config& team::variables ( ) const
inline

Definition at line 360 of file team.hpp.

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

int team::village_gold ( ) const
inline
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 204 of file team.hpp.

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

Referenced by editor::context_manager::edit_side_dialog(), impl_side_get(), team::team_info::read(), and support().

const std::set<map_location>& team::villages ( ) const
inline
void team::write ( config cfg) const

Member Data Documentation

int team::action_bonus_count_
private

Definition at line 419 of file team.hpp.

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

idle team::ALL

Definition at line 74 of file team.hpp.

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

Definition at line 428 of file team.hpp.

Referenced by ally_fog().

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

Definition at line 428 of file team.hpp.

Referenced by ally_shroud().

const boost::container::flat_set< std::string > team::attributes
static
Initial value:
= boost::assign::list_of<std::string>("ai_config")
("carryover_add")("carryover_percentage")("color")("controller")("current_player")("defeat_condition")("flag")
("flag_icon")("fog")("fog_data")("gold")("hidden")("income")
("no_leader")("objectives")("objectives_changed")("persistent")("lost")
("recall_cost")("recruit")("save_id")("scroll_to_leader")
("share_vision")("share_maps")("share_view")("shroud")("shroud_data")("start_gold")
("suppress_end_turn_confirmation")
("team_name")("user_team_name")("side_name")("village_gold")("village_support")("is_local")
("player_id")("action_bonus_count")("allow_changes")("allow_player")("color_lock")
("countdown_time")("disallow_observers")("faction")
("faction_from_recruit")("faction_name")("gold_lock")("income_lock")
("leader")("random_leader")("team_lock")("terrain_liked")
("user_description")("controller_lock")("chose_random")
("disallow_shuffle")("description").convert_to_container<boost::container::flat_set<std::string> >()

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

Referenced by team_builder::handle_leader().

bool team::auto_shroud_updates_
private

Definition at line 414 of file team.hpp.

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

int team::countdown_time_
mutableprivate

Definition at line 418 of file team.hpp.

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

const int team::default_team_gold_ = 100
staticprivate

Definition at line 172 of file team.hpp.

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

std::vector<bool> team::enemies_
mutableprivate

Definition at line 426 of file team.hpp.

Referenced by calculate_enemies(), and is_enemy().

shroud_map team::fog_
private

Definition at line 410 of file team.hpp.

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

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

Stores hexes that have been cleared of fog via WML.

Definition at line 412 of file team.hpp.

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

int team::gold_
private

Definition at line 407 of file team.hpp.

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

team_info team::info_
private

Definition at line 416 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(), color(), controller(), current_player(), defeat_condition(), 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(), 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_start_gold(), set_village_gold(), set_village_support(), share_maps(), share_view(), share_vision(), side(), side_name(), start_gold(), team_name(), toggle_droid(), toggle_idle(), total_income(), user_team_name(), variables(), village_gold(), village_support(), and write().

std::string team::last_recruit_
private

Definition at line 422 of file team.hpp.

Referenced by last_recruit().

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

Whiteboard planned actions for this team.

Definition at line 433 of file team.hpp.

Referenced by build(), and get_side_actions().

team::PROXY_HUMAN

Definition at line 61 of file team.hpp.

recall_list_manager team::recall_list_
private

Definition at line 421 of file team.hpp.

Referenced by recall_list().

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

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