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_manager & | recall_list () |
const recall_list_manager & | recall_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_string & | objectives () 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_string & | user_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_string & | faction_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 |
config & | variables () |
const config & | variables () const |
bool | no_turn_confirmation () const |
void | set_no_turn_confirmation (bool value) |
void | log_recruitable () const |
std::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 |
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_location > | villages_ |
shroud_map | shroud_ |
shroud_map | fog_ |
std::set< map_location > | fog_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_actions > | planned_actions_ |
Whiteboard planned actions for this team. More... | |
Static Private Attributes | |
static const int | default_team_gold_ = 100 |
This class stores all the data for a single 'side' (in game nomenclature).
E.g., there is only one leader unit per team.
|
inline |
Definition at line 199 of file team.hpp.
References action_bonus_count_.
Referenced by playmp_controller::after_human_turn(), events::menu_handler::do_recruit(), team::team_info::read(), actions::shroud_clearing_action::return_village(), actions::shroud_clearing_action::take_village(), actions::undo::recruit_action::undo(), and team::team_info::write().
|
inline |
Records hexes that were cleared of fog via WML.
Definition at line 320 of file team.hpp.
References fog_clearer_.
void team::add_recruit | ( | const std::string & | recruit | ) |
Definition at line 479 of file team.cpp.
References team::team_info::can_recruit, ai::manager::get_singleton(), info_, team::team_info::minimum_recruit_price, and ai::manager::raise_recruit_list_changed().
Referenced by team_builder::previous_recruits().
std::string team::allied_human_teams | ( | ) | const |
Definition at line 1053 of file team.cpp.
References resources::gameboard, utils::join(), and t.
|
private |
|
private |
Definition at line 677 of file team.cpp.
References ally_shroud_, is_enemy(), and t.
Referenced by shrouded().
|
inline |
Definition at line 324 of file team.hpp.
References auto_shroud_updates_.
Referenced by actions::undo_list::apply_shroud_changes(), actions::shroud_clearer::clear_unit(), actions::place_recruit(), playsingle_controller::play_ai_turn(), SYNCED_COMMAND_HANDLER_FUNCTION(), and events::menu_handler::toggle_shroud_updates().
|
inline |
Definition at line 177 of file team.hpp.
References game_config::base_income, team::team_info::income, and info_.
Referenced by ai::default_recruitment::recruitment::get_estimated_income(), wfl::team_callable::get_value(), gui2::dialogs::game_stats::pre_show(), editor::map_context::to_config(), and total_income().
void team::build | ( | const config & | cfg, |
const gamemap & | map, | ||
int | gold = default_team_gold_ |
||
) |
Definition at line 352 of file team.cpp.
References action_bonus_count_, auto_shroud_updates_, config::child_range(), countdown_time_, current_player(), fog_, fog_clearer_, team::team_info::gold, gold(), gold_, info_, gamemap::is_village(), LOG_NG, config::optional_child(), gamemap_base::parse_location_range(), planned_actions_, team::team_info::read(), shroud_map::read(), shroud_map::set_enabled(), shroud_, team::team_info::side, team::team_info::start_gold, team::team_info::team_name, uses_fog(), uses_shroud(), villages_, and WRN_NG.
Referenced by team_builder::new_team().
|
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().
|
private |
Definition at line 519 of file team.cpp.
References resources::gameboard, utf8::index(), info_, LOG_NGE, team::team_info::side, utils::split(), t, team::team_info::team_name, and game_board::teams().
Referenced by calculate_enemies().
|
inline |
Definition at line 343 of file team.hpp.
References team::team_info::carryover_add, and info_.
Referenced by wfl::team_callable::get_value(), team::team_info::read(), and team::team_info::write().
|
inline |
Definition at line 345 of file team.hpp.
References team::team_info::carryover_bonus, and info_.
Referenced by wfl::team_callable::get_value(), team::team_info::read(), and team::team_info::write().
|
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().
|
inline |
Definition at line 341 of file team.hpp.
References team::team_info::carryover_percentage, and info_.
Referenced by wfl::team_callable::get_value(), team::team_info::read(), and team::team_info::write().
|
inline |
Definition at line 261 of file team.hpp.
References team::team_info::controller, string_enums::enum_base< Definition >::get_enum(), and info_.
Referenced by change_controller_by_wml(), and game_board::side_drop_to().
|
inline |
Definition at line 264 of file team.hpp.
References team::team_info::controller, controller(), and info_.
void team::change_controller_by_wml | ( | const std::string & | new_controller | ) |
Definition at line 583 of file team.cpp.
References synced_context::ask_server_choice(), change_controller(), resources::controller, controller(), string_enums::enum_base< Definition >::get_enum(), set_local(), side(), and WRN_NG.
|
inline |
Definition at line 277 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 | ||
) |
Definition at line 616 of file team.cpp.
References clear_caches(), t_string::empty(), info_, team::team_info::team_name, and team::team_info::user_team_name.
|
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().
|
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().
|
inline |
Definition at line 308 of file team.hpp.
References shroud_map::clear(), fog_, map_location::wml_x(), and map_location::wml_y().
Referenced by actions::shroud_clearer::clear_loc().
|
inline |
Definition at line 275 of file team.hpp.
References make_proxy_human().
|
inline |
Definition at line 306 of file team.hpp.
References shroud_map::clear(), shroud_, map_location::wml_x(), and map_location::wml_y().
Referenced by actions::shroud_clearer::clear_loc().
|
inline |
Definition at line 242 of file team.hpp.
References team::team_info::color, and info_.
Referenced by gui2::dialogs::add_unit_entry(), wfl::team_callable::get_value(), gui2::dialogs::statistics_dialog::on_primary_list_select(), gui2::dialogs::game_stats::pre_show(), gui2::dialogs::unit_recruit::pre_show(), team::team_info::read(), set_color(), unit_side(), and team::team_info::write().
|
inline |
Definition at line 241 of file team.hpp.
References team::team_info::controller, and info_.
Referenced by change_controller(), change_controller_by_wml(), team::team_info::read(), editor::map_context::to_config(), and team::team_info::write().
|
inline |
Definition at line 196 of file team.hpp.
References countdown_time_.
Referenced by playmp_controller::after_human_turn(), countdown_clock::maybe_play_sound(), team::team_info::read(), REPORT_GENERATOR(), countdown_clock::update(), countdown_clock::update_team(), and team::team_info::write().
|
inline |
Definition at line 220 of file team.hpp.
References team::team_info::current_player, and info_.
Referenced by build(), gui2::dialogs::mp_change_control::pre_show(), playmp_controller::process_network_side_drop_impl(), team::team_info::read(), and team::team_info::write().
|
inline |
Definition at line 328 of file team.hpp.
References team::team_info::defeat_cond, and info_.
Referenced by game_board::check_victory(), team::team_info::read(), and team::team_info::write().
|
inline |
Definition at line 296 of file team.hpp.
References team::team_info::faction, and info_.
Referenced by wfl::team_callable::get_value(), team::team_info::read(), and team::team_info::write().
|
inline |
Definition at line 297 of file team.hpp.
References team::team_info::faction_name, and info_.
Referenced by wfl::team_callable::get_value(), team::team_info::read(), and team::team_info::write().
void team::fix_villages | ( | const gamemap & | map | ) |
Definition at line 424 of file team.cpp.
References gamemap::is_village(), and villages_.
|
inline |
Definition at line 286 of file team.hpp.
References team::team_info::flag, and info_.
Referenced by wfl::team_callable::get_value(), team::team_info::read(), set_flag(), and team::team_info::write().
|
inline |
Definition at line 287 of file team.hpp.
References team::team_info::flag_icon, and info_.
Referenced by wfl::team_callable::get_value(), team::team_info::read(), REPORT_GENERATOR(), set_flag_icon(), unit_side(), and team::team_info::write().
|
inline |
Definition at line 305 of file team.hpp.
References uses_fog(), and uses_shroud().
Referenced by actions::undo_list::apply_shroud_changes(), actions::shroud_clearer::clear_dest(), actions::shroud_clearer::clear_unit(), and actions::move_unit_and_record().
bool team::fogged | ( | const map_location & | loc | ) | const |
Definition at line 659 of file team.cpp.
References ally_fog(), fog_, fog_clearer_, resources::gameboard, shroud_map::shared_value(), shrouded(), shroud_map::value(), map_location::wml_x(), and map_location::wml_y().
Referenced by actions::shroud_clearer::clear_loc(), display::fogged(), get_visible_time_of_day_at(), unit::is_visible_to_team(), pathfind::mark_route(), terrain_filter::match_internal(), image::prep_minimap_for_rendering(), actions::recalculate_fog(), REPORT_GENERATOR(), and pathfind::teleport_map::teleport_map().
|
inline |
Definition at line 326 of file team.hpp.
References team::team_info::disallow_observers, and info_.
|
static |
Definition at line 964 of file team.cpp.
References get_side_color_range(), color_range::rep(), and side().
Referenced by display::draw_minimap_units(), and image::prep_minimap_for_rendering().
|
inline |
Definition at line 206 of file team.hpp.
References info_, and team::team_info::scroll_to_leader.
void team::get_shared_maps | ( | ) |
|
inline |
get the whiteboard planned actions for this team
Definition at line 371 of file team.hpp.
References planned_actions_.
Referenced by wb::current_side_actions(), wb::recall::execute(), wb::find_actions_of(), wb::manager::get_spent_gold_for(), wb::manager::on_change_controller(), wb::manager::process_network_data(), and wb::viewer_actions().
|
static |
Definition at line 959 of file team.cpp.
References get_side_color_range(), color_range::mid(), and side().
Referenced by wb::draw_numbers(), events::menu_handler::label_terrain(), and gui2::dialogs::mp_change_control::pre_show().
|
static |
Definition at line 971 of file team.cpp.
References game_config::default_colors, resources::gameboard, utf8::index(), side(), and game_board::teams().
Referenced by wb::manager::create_temp_move(), unit_drawer::draw_ellipses(), get_side_color_id_from_config(), get_side_color_name_for_UI(), get_side_color_range(), wb::move::move(), REPORT_GENERATOR(), gui2::unit_preview_pane::set_displayed_type(), editor::mouse_action_unit::set_unit_mouse_overlay(), editor::unit_palette::setup_item(), and unit::TC_image_mods().
|
static |
Definition at line 1010 of file team.cpp.
References c, get_side_color_id(), and side().
Referenced by savegame::extract_summary_from_config(), team::team_info::read(), and ng::side_engine::side_engine().
|
static |
Definition at line 998 of file team.cpp.
References get_side_color_id(), side(), game_config::team_rgb_name, and VGETTEXT.
Referenced by gui2::dialogs::game_stats::pre_show(), and side_tooltip().
|
static |
Definition at line 947 of file team.cpp.
References get_side_color_id(), utf8::index(), side(), and game_config::team_rgb_range.
Referenced by display_chat_manager::add_chat_message(), get_minimap_color(), get_side_color(), and get_side_highlight_pango().
|
static |
Definition at line 1030 of file team.cpp.
References get_side_color_range(), color_range::mid(), side(), and color_t::to_hex_string().
Referenced by chat_msg::chat_msg(), and gui2::dialogs::game_stats::pre_show().
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().
|
inline |
Definition at line 175 of file team.hpp.
References gold_.
Referenced by build(), events::menu_handler::can_recruit(), ai::ai_default_rca::leader_shares_keep_phase::execute(), wfl::team_callable::get_value(), ai_testing::log_turn(), gui2::dialogs::game_stats::pre_show(), gui2::dialogs::unit_recall::pre_show(), team::team_info::read(), events::menu_handler::recall(), REPORT_GENERATOR(), SYNCED_COMMAND_HANDLER_FUNCTION(), ai::recall_result::test_enough_gold(), ai::recruit_result::test_enough_gold(), editor::map_context::to_config(), and team::team_info::write().
|
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().
|
inline |
Definition at line 332 of file team.hpp.
References info_, and team::team_info::no_leader.
|
inline |
Definition at line 333 of file team.hpp.
References team::team_info::hidden, and info_.
Referenced by wfl::team_callable::get_value(), gui2::dialogs::label_settings::label_settings(), gui2::dialogs::game_stats::pre_show(), team::team_info::read(), editor::map_context::to_config(), and team::team_info::write().
|
inline |
Definition at line 251 of file team.hpp.
References team::team_info::controller, and info_.
Referenced by synced_context::ignore_undo(), is_local_ai(), is_network_ai(), and game_board::side_change_controller().
|
inline |
Definition at line 269 of file team.hpp.
References info_, and team::team_info::proxy_controller.
|
inline |
Definition at line 245 of file team.hpp.
References team::team_info::controller, and info_.
Referenced by mp_sync::get_user_choice(), is_local(), is_network(), and gui2::dialogs::mp_change_control::pre_show().
|
inline |
Definition at line 229 of file team.hpp.
References calculate_enemies(), enemies_, utf8::index(), and n.
Referenced by unit::ability_active(), ally_fog(), ally_shroud(), ai::attack_analysis::analyze(), attack_info(), actions::shroud_clearer::clear_loc(), wfl::attack_map_callable::collect_possible_attacks(), actions::create_jamming_map(), events::mouse_handler::current_unit_attacks_from(), ai::ai_default_rca::aspect_attacks_base::do_attack_analysis(), pathfind::enemy_zoc(), pathfind::find_routes(), events::mouse_handler::get_adj_enemies(), ai::default_recruitment::recruitment::get_unit_ratio(), ai::ai_default_rca::aspect_attacks::is_allowed_enemy(), 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(), image::prep_minimap_for_rendering(), unit_drawer::redraw_unit(), unit_display::unit_mover::replace_temporary(), REPORT_GENERATOR(), events::mouse_handler::show_attack_options(), attack_type::special_active_impl(), pathfind::teleport_map::teleport_map(), and display_context::unit_can_move().
|
inline |
Definition at line 250 of file team.hpp.
References team::team_info::controller, and info_.
Referenced by is_local_human(), is_network_human(), and game_board::side_change_controller().
|
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().
|
inline |
Definition at line 247 of file team.hpp.
References info_, is_empty(), and team::team_info::is_local.
Referenced by is_local_ai(), is_local_human(), playmp_controller::process_network_change_controller_impl(), team::team_info::read(), wb::manager::should_clear_undo(), verify_and_clear_global_variable(), and verify_and_set_global_variable().
|
inline |
Definition at line 254 of file team.hpp.
References is_ai(), and is_local().
Referenced by wfl::team_callable::get_value(), gui2::dialogs::mp_change_control::pre_show(), and SYNCED_COMMAND_HANDLER_FUNCTION().
|
inline |
Definition at line 253 of file team.hpp.
References is_human(), and is_local().
Referenced by play_controller::can_use_synced_wml_menu(), gui2::dialogs::get_title_suffix(), wfl::team_callable::get_value(), and wb::manager::on_change_controller().
|
inline |
Definition at line 248 of file team.hpp.
References info_, is_empty(), and team::team_info::is_local.
Referenced by wfl::team_callable::get_value(), is_network_ai(), and is_network_human().
|
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().
|
inline |
Definition at line 255 of file team.hpp.
References is_human(), and is_network().
|
inline |
Definition at line 268 of file team.hpp.
References info_, and team::team_info::proxy_controller.
bool team::knows_about_team | ( | std::size_t | index | ) | const |
Definition at line 703 of file team.cpp.
References resources::gameboard, utf8::index(), is_enemy(), share_maps(), share_view(), t, game_board::teams(), uses_fog(), and uses_shroud().
Referenced by gui2::dialogs::game_stats::pre_show().
|
inline |
Definition at line 214 of file team.hpp.
References last_recruit_.
Referenced by events::menu_handler::can_recruit().
|
inline |
Definition at line 215 of file team.hpp.
References last_recruit_.
void team::log_recruitable | ( | ) | const |
Definition at line 1035 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 462 of file team.cpp.
References villages_.
Referenced by game_board::change_terrain(), game_lua_kernel::intf_set_village_owner(), and game_board::replace_map().
|
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().
|
inline |
Definition at line 260 of file team.hpp.
References team::team_info::controller, and info_.
Referenced by game_board::side_change_controller(), and playsingle_controller::sync_end_turn().
|
inline |
Definition at line 272 of file team.hpp.
References info_, and team::team_info::proxy_controller.
|
inline |
Definition at line 259 of file team.hpp.
References team::team_info::controller, and info_.
Referenced by playsingle_controller::play_ai_turn(), and game_board::side_change_controller().
|
inline |
Definition at line 273 of file team.hpp.
References info_, and team::team_info::proxy_controller.
|
inline |
Definition at line 274 of file team.hpp.
References info_, and team::team_info::proxy_controller.
Referenced by clear_proxy().
|
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().
int team::minimum_recruit_price | ( | ) | const |
Definition at line 486 of file team.cpp.
References team::team_info::can_recruit, unit_type::cost(), unit_type_data::find(), info_, team::team_info::minimum_recruit_price, and unit_types.
Referenced by ai::ai_default_rca::leader_shares_keep_phase::execute().
|
inline |
Definition at line 190 of file team.hpp.
References gold_, and total_income().
Referenced by play_controller::do_init_side().
|
inline |
Definition at line 327 of file team.hpp.
References info_, and team::team_info::no_leader.
Referenced by team::team_info::read(), editor::map_context::to_config(), and team::team_info::write().
|
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().
|
inline |
Definition at line 226 of file team.hpp.
References info_, and team::team_info::objectives.
Referenced by team_builder::objectives(), team::team_info::read(), and team::team_info::write().
|
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().
|
inline |
Definition at line 171 of file team.hpp.
References villages_.
Referenced by pathfind::mark_route(), terrain_filter::match_internal(), wb::path_cost(), and image::prep_minimap_for_rendering().
|
inline |
Definition at line 335 of file team.hpp.
References info_, and team::team_info::persistent.
Referenced by game_board::heal_all_survivors(), team::team_info::read(), and team::team_info::write().
|
inline |
Definition at line 307 of file team.hpp.
References shroud_map::place(), shroud_, map_location::wml_x(), and map_location::wml_y().
|
inline |
Definition at line 267 of file team.hpp.
References info_, and team::team_info::proxy_controller.
|
inline |
Definition at line 179 of file team.hpp.
References info_, and team::team_info::recall_cost.
Referenced by unit::apply_builtin_effect(), wb::recall::execute(), ai::default_recruitment::recruitment::get_cheapest_unit_cost_for_leader(), wfl::team_callable::get_value(), gui2::dialogs::unit_recall::pre_show(), team::team_info::read(), events::menu_handler::recall(), actions::recall_unit(), ai::default_recruitment::recruitment::recall_unit_value(), ai::simulated_recall(), ai::recall_result::test_enough_gold(), actions::undo::recall_action::undo(), and team::team_info::write().
|
inline |
Definition at line 201 of file team.hpp.
References recall_list_.
Referenced by unit_creator::add_unit(), gui2::dialogs::unit_recall::dismiss_unit(), lua_unit::get(), ai::recall_result::get_recall_unit(), lua_unit::get_shared(), wfl::team_callable::get_value(), team_builder::handle_unit(), game_events::builtin_conditions::have_unit(), lua_unit::put_map(), events::menu_handler::recall(), actions::recall_unit(), gui2::dialogs::team_mode_controller::show_recall_unit(), ai::simulated_recall(), SYNCED_COMMAND_HANDLER_FUNCTION(), game_board::try_add_unit_to_recall_list(), actions::undo::dismiss_action::undo(), and actions::undo::recall_action::undo().
|
inline |
Definition at line 202 of file team.hpp.
References recall_list_.
|
inline |
Definition at line 209 of file team.hpp.
References team::team_info::can_recruit, and info_.
Referenced by ai::default_recruitment::recruitment::do_combat_analysis(), ai::default_recruitment::recruitment::get_cost_map_of_side(), actions::get_recruits(), gui2::dialogs::get_title_suffix(), wfl::team_callable::get_value(), team::team_info::read(), set_recruits(), editor::map_context::to_config(), and ai::default_recruitment::recruitment::update_average_local_cost().
|
inline |
Definition at line 310 of file team.hpp.
References fog_, and shroud_map::reset().
Referenced by actions::recalculate_fog().
void team::remove_fog_override | ( | const std::set< map_location > & | hexes | ) |
Removes the record of hexes that were cleared of fog via WML.
[in] | hexes | The hexes to no longer keep clear. |
Definition at line 744 of file team.cpp.
References fog_clearer_.
|
inline |
Definition at line 224 of file team.hpp.
References info_, and team::team_info::objectives_changed.
|
inline |
Definition at line 309 of file team.hpp.
References shroud_map::reset(), and shroud_.
|
inline |
Definition at line 217 of file team.hpp.
References info_, and team::team_info::save_id.
Referenced by wfl::team_callable::get_value(), team::team_info::read(), set_save_id(), and team::team_info::write().
|
inline |
Definition at line 218 of file team.hpp.
References info_, team::team_info::save_id, and team::team_info::side.
Referenced by game_events::builtin_conditions::have_unit().
|
inline |
Definition at line 200 of file team.hpp.
References action_bonus_count_.
Referenced by playmp_controller::after_human_turn(), events::mouse_handler::attack_enemy_(), events::menu_handler::do_recruit(), actions::shroud_clearing_action::return_village(), actions::shroud_clearing_action::take_village(), and actions::undo::recruit_action::undo().
|
inline |
Definition at line 325 of file team.hpp.
References auto_shroud_updates_.
Referenced by SYNCED_COMMAND_HANDLER_FUNCTION().
|
inline |
Definition at line 195 of file team.hpp.
References game_config::base_income, team::team_info::income, and info_.
|
inline |
Definition at line 342 of file team.hpp.
References team::team_info::carryover_add, and info_.
|
inline |
Definition at line 344 of file team.hpp.
References team::team_info::carryover_bonus, and info_.
|
inline |
Definition at line 346 of file team.hpp.
References team::team_info::carryover_gold, and info_.
|
inline |
Definition at line 340 of file team.hpp.
References team::team_info::carryover_percentage, and info_.
|
inline |
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().
|
inline |
Definition at line 197 of file team.hpp.
References countdown_time_.
Referenced by playmp_controller::after_human_turn(), do_replay_handle(), and countdown_clock::update_team().
|
inline |
Definition at line 203 of file team.hpp.
References team::team_info::current_player, and info_.
Referenced by game_board::side_change_controller(), and game_board::side_drop_to().
|
inline |
Definition at line 329 of file team.hpp.
References team::team_info::defeat_cond, and info_.
|
inline |
sets the defeat condition if
value | is 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_.
|
inline |
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().
|
inline |
Definition at line 291 of file team.hpp.
References team::team_info::flag_icon, flag_icon(), and info_.
|
inline |
Definition at line 312 of file team.hpp.
References fog_, and shroud_map::set_enabled().
Referenced by SYNCED_COMMAND_HANDLER_FUNCTION().
|
inline |
Definition at line 334 of file team.hpp.
References team::team_info::hidden, and info_.
|
inline |
Definition at line 258 of file team.hpp.
References info_, and team::team_info::is_local.
Referenced by change_controller_by_wml(), game_board::side_change_controller(), and game_board::side_drop_to().
|
inline |
Definition at line 337 of file team.hpp.
References info_, and team::team_info::lost.
|
inline |
Definition at line 352 of file team.hpp.
References info_, and team::team_info::no_turn_confirmation.
void team::set_objectives | ( | const t_string & | new_objectives, |
bool | silently = false |
||
) |
Definition at line 641 of file team.cpp.
References info_, team::team_info::objectives, and team::team_info::objectives_changed.
Referenced by team_builder::objectives().
|
inline |
Definition at line 223 of file team.hpp.
References c, info_, and team::team_info::objectives_changed.
|
inline |
Definition at line 336 of file team.hpp.
References info_, and team::team_info::persistent.
|
inline |
Definition at line 181 of file team.hpp.
References info_, and team::team_info::recall_cost.
void team::set_recruits | ( | const std::set< std::string > & | recruits | ) |
Definition at line 469 of file team.cpp.
References team::team_info::can_recruit, ai::manager::get_singleton(), ai::manager::has_manager(), info_, team::team_info::minimum_recruit_price, ai::manager::raise_recruit_list_changed(), and recruits().
|
inline |
Definition at line 219 of file team.hpp.
References info_, team::team_info::save_id, and save_id().
|
inline |
Definition at line 207 of file team.hpp.
References info_, and team::team_info::scroll_to_leader.
|
inline |
Definition at line 379 of file team.hpp.
References clear_caches(), string_enums::enum_base< Definition >::get_enum(), info_, and team::team_info::share_vision.
|
inline |
Definition at line 384 of file team.hpp.
References clear_caches(), info_, and team::team_info::share_vision.
|
inline |
Definition at line 311 of file team.hpp.
References shroud_map::set_enabled(), and shroud_.
Referenced by SYNCED_COMMAND_HANDLER_FUNCTION().
|
inline |
Definition at line 295 of file team.hpp.
References team::team_info::current_player, info_, and team::team_info::side_name.
|
inline |
Definition at line 193 of file team.hpp.
References info_, and team::team_info::start_gold.
|
inline |
Definition at line 180 of file team.hpp.
References team::team_info::income_per_village, and info_.
|
inline |
support | The 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.
|
inline |
Definition at line 375 of file team.hpp.
References info_, and team::team_info::share_vision.
Referenced by knows_about_team().
|
inline |
Definition at line 376 of file team.hpp.
References info_, and team::team_info::share_vision.
Referenced by knows_about_team().
|
inline |
Definition at line 377 of file team.hpp.
References info_, and team::team_info::share_vision.
Referenced by wfl::team_callable::get_value(), team::team_info::handle_legacy_share_vision(), team::team_info::read(), editor::map_context::to_config(), and team::team_info::write().
|
inline |
Definition at line 313 of file team.hpp.
References shroud_, and shroud_map::write().
Referenced by merge_shroud_map_data().
bool team::shrouded | ( | const map_location & | loc | ) | const |
Definition at line 650 of file team.cpp.
References ally_shroud(), resources::gameboard, shroud_map::shared_value(), shroud_, shroud_map::value(), map_location::wml_x(), and map_location::wml_y().
Referenced by game_state::can_recruit_on(), pathfind::shortest_path_calculator::cost(), pathfind::move_type_path_calculator::cost(), pathfind::find_routes(), pathfind::find_vacant_tile(), fogged(), get_visible_time_of_day_at(), terrain_filter::match_internal(), image::prep_minimap_for_rendering(), REPORT_GENERATOR(), and display::shrouded().
|
inline |
Definition at line 174 of file team.hpp.
References info_, and team::team_info::side.
Referenced by unit_creator::add_unit(), attack_info(), wb::move::calculate_moves_left(), change_controller_by_wml(), wb::manager::create_temp_move(), events::mouse_handler::current_unit_attacks_from(), ai::default_recruitment::recruitment::do_combat_analysis(), ai::default_recruitment::recruitment::execute(), unit_creator::find_location(), get_minimap_color(), get_side_color(), get_side_color_id(), get_side_color_id_from_config(), get_side_color_name_for_UI(), get_side_color_range(), get_side_highlight_pango(), gui2::dialogs::get_title_suffix(), ai::default_recruitment::recruitment::get_unit_ratio(), wfl::team_callable::get_value(), events::menu_handler::has_friends(), impl_side_tostring(), unit::is_visible_to_team(), gui2::dialogs::label_settings::label_settings(), playsingle_controller::play_side_impl(), gui2::dialogs::game_stats::pre_show(), gui2::dialogs::unit_recall::pre_show(), image::prep_minimap_for_rendering(), playmp_controller::process_network_change_controller_impl(), playmp_controller::process_network_side_drop_impl(), team::team_info::read(), unit_drawer::redraw_unit(), unit_display::unit_mover::replace_temporary(), REPORT_GENERATOR(), editor::mouse_action_unit::set_unit_mouse_overlay(), editor::unit_palette::setup_item(), side_tooltip(), SYNCED_COMMAND_HANDLER_FUNCTION(), actions::shroud_clearing_action::take_village(), unit_moves(), editor::mouse_action_unit::up_left(), ai::default_recruitment::recruitment::update_important_hexes(), wb::viewer_side(), and team::team_info::write().
|
inline |
Definition at line 293 of file team.hpp.
References team::team_info::current_player, t_string::empty(), info_, team::team_info::side_name, and t_string::str().
Referenced by impl_side_tostring(), gui2::dialogs::label_settings::label_settings(), gui2::dialogs::game_stats::pre_show(), gui2::dialogs::statistics_dialog::pre_show(), team::team_info::read(), playsingle_controller::show_turn_dialog(), side_tooltip(), and team::team_info::write().
|
inline |
Definition at line 294 of file team.hpp.
References team::team_info::current_player, t_string::empty(), info_, and team::team_info::side_name.
|
inline |
Definition at line 194 of file team.hpp.
References gold_.
Referenced by play_controller::do_init_side(), actions::place_recruit(), ai::simulated_recall(), ai::simulated_recruit(), SYNCED_COMMAND_HANDLER_FUNCTION(), actions::undo::recall_action::undo(), and actions::undo::recruit_action::undo().
|
inline |
Definition at line 176 of file team.hpp.
References info_, and team::team_info::start_gold.
Referenced by wfl::team_callable::get_value(), gui2::dialogs::game_stats::pre_show(), team::team_info::read(), and team::team_info::write().
|
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().
|
inline |
Definition at line 282 of file team.hpp.
References info_, and team::team_info::team_name.
Referenced by game_display::current_team_name(), wfl::team_callable::get_value(), events::menu_handler::has_friends(), game_lua_kernel::intf_get_label(), gui2::dialogs::game_stats::pre_show(), team::team_info::read(), map_labels::team_name(), editor::map_context::to_config(), and team::team_info::write().
config team::to_config | ( | ) | const |
Definition at line 1045 of file team.cpp.
References config::add_child(), and write().
Referenced by gui2::dialogs::team_mode_controller::show_list(), and team::team_info::write().
|
inline |
Definition at line 279 of file team.hpp.
References info_, and team::team_info::proxy_controller.
|
inline |
Definition at line 280 of file team.hpp.
References info_, and team::team_info::proxy_controller.
|
inline |
Definition at line 182 of file team.hpp.
References base_income(), team::team_info::income_per_village, info_, and villages_.
Referenced by ai::ai_default_rca::leader_shares_keep_phase::execute(), wfl::team_callable::get_value(), ai_testing::log_turn(), and new_turn().
|
inline |
Definition at line 283 of file team.hpp.
References info_, and team::team_info::user_team_name.
Referenced by gui2::dialogs::gamestate_inspector::controller::build_stuff_list(), gui2::dialogs::label_settings::label_settings(), gui2::dialogs::game_stats::pre_show(), team::team_info::read(), editor::map_context::to_config(), and team::team_info::write().
|
inline |
Definition at line 304 of file team.hpp.
References shroud_map::enabled(), and fog_.
Referenced by build(), actions::clear_shroud(), fog_or_shroud(), wfl::team_callable::get_value(), knows_about_team(), gui2::dialogs::game_stats::pre_show(), actions::recalculate_fog(), SYNCED_COMMAND_HANDLER_FUNCTION(), editor::map_context::to_config(), and write().
|
inline |
Definition at line 303 of file team.hpp.
References shroud_map::enabled(), and shroud_.
Referenced by build(), actions::clear_shroud(), pathfind::find_vacant_tile(), fog_or_shroud(), wfl::team_callable::get_value(), knows_about_team(), gui2::dialogs::game_stats::pre_show(), REPORT_GENERATOR(), SYNCED_COMMAND_HANDLER_FUNCTION(), editor::map_context::to_config(), and write().
|
inline |
Definition at line 348 of file team.hpp.
References info_, and team::team_info::variables.
Referenced by wfl::team_callable::get_value(), team::team_info::read(), and team::team_info::write().
|
inline |
Definition at line 349 of file team.hpp.
References info_, and team::team_info::variables.
|
inline |
Definition at line 178 of file team.hpp.
References team::team_info::income_per_village, and info_.
Referenced by wfl::team_callable::get_value(), and gui2::dialogs::game_stats::pre_show().
|
inline |
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().
|
inline |
Definition at line 170 of file team.hpp.
References villages_.
Referenced by ai::default_recruitment::recruitment::get_estimated_income(), ai_testing::log_turn(), gui2::dialogs::game_stats::pre_show(), REPORT_GENERATOR(), and editor::map_context::to_config().
void team::write | ( | config & | cfg | ) | const |
Definition at line 402 of file team.cpp.
References action_bonus_count_, config::add_child(), auto_shroud_updates_, countdown_time_, fog_, fog_clearer_, gold_, info_, shroud_, uses_fog(), uses_shroud(), villages_, shroud_map::write(), team::team_info::write(), and write_location_range().
Referenced by to_config().
|
private |
Definition at line 417 of file team.hpp.
Referenced by action_bonus_count(), build(), set_action_bonus_count(), and write().
|
private |
Definition at line 427 of file team.hpp.
Referenced by ally_fog().
|
mutableprivate |
Definition at line 427 of file team.hpp.
Referenced by ally_shroud().
|
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().
|
private |
Definition at line 412 of file team.hpp.
Referenced by auto_shroud_updates(), build(), set_auto_shroud_updates(), and write().
|
mutableprivate |
Definition at line 416 of file team.hpp.
Referenced by build(), countdown_time(), set_countdown_time(), and write().
|
staticprivate |
Definition at line 144 of file team.hpp.
Referenced by team::team_info::read().
|
mutableprivate |
Definition at line 425 of file team.hpp.
Referenced by calculate_enemies(), and is_enemy().
|
private |
Definition at line 408 of file team.hpp.
Referenced by build(), clear_fog(), fogged(), refog(), set_fog(), uses_fog(), and write().
|
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().
|
private |
Definition at line 405 of file team.hpp.
Referenced by build(), gold(), new_turn(), set_gold(), spend_gold(), and write().
|
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().
|
private |
Definition at line 420 of file team.hpp.
Referenced by last_recruit().
|
private |
Whiteboard planned actions for this team.
Definition at line 432 of file team.hpp.
Referenced by build(), and get_side_actions().
|
private |
Definition at line 419 of file team.hpp.
Referenced by recall_list().
|
private |
Definition at line 408 of file team.hpp.
Referenced by build(), clear_shroud(), merge_shroud_map_data(), place_shroud(), reshroud(), set_shroud(), shroud_data(), shrouded(), uses_shroud(), and write().
|
private |
Definition at line 406 of file team.hpp.
Referenced by build(), clear_villages(), fix_villages(), get_village(), lose_village(), owns_village(), support(), total_income(), villages(), and write().