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_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 |
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 |
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_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 |
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) |
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 |
config & | variables () |
const config & | variables () 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_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_ |
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 |
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 218 of file team.hpp.
References action_bonus_count_.
Referenced by playmp_controller::after_human_turn(), events::menu_handler::do_recruit(), actions::get_village(), team::team_info::read(), actions::undo::recruit_action::redo(), 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 331 of file team.hpp.
References fog_clearer_.
Referenced by game_lua_kernel::intf_toggle_fog().
void team::add_recruit | ( | const std::string & | recruit | ) |
Definition at line 413 of file team.cpp.
References team::team_info::can_recruit, info_, team::team_info::minimum_recruit_price, and ai::manager::raise_recruit_list_changed().
Referenced by impl_side_set(), and team_builder::previous_recruits().
idle team::all | ( | SHROUD | , |
"shroud" | |||
) |
std::string team::allied_human_teams | ( | ) | const |
Definition at line 880 of file team.cpp.
References utils::join().
|
private |
Definition at line 602 of file team.cpp.
References ally_fog_, fog_, i, is_enemy(), and share_view().
Referenced by fogged().
|
private |
Definition at line 589 of file team.cpp.
References ally_shroud_, i, is_enemy(), share_view(), and shroud_.
Referenced by shrouded().
|
inline |
Definition at line 335 of file team.hpp.
References auto_shroud_updates_.
Referenced by actions::undo_list::apply_shroud_changes(), actions::shroud_clearer::clear_unit(), playsingle_controller::play_ai_turn(), SYNCED_COMMAND_HANDLER_FUNCTION(), and events::menu_handler::toggle_shroud_updates().
|
inline |
Definition at line 196 of file team.hpp.
References game_config::base_income, team::team_info::income, and info_.
Referenced by editor::context_manager::edit_side_dialog(), ai::default_recruitment::recruitment::get_estimated_income(), impl_side_get(), and total_income().
void team::build | ( | const config & | cfg, |
const gamemap & | map, | ||
int | gold = default_team_gold_ |
||
) |
Definition at line 306 of file team.cpp.
References action_bonus_count_, auto_shroud_updates_, config::child(), config::child_range(), countdown_time_, current_player(), fog_, fog_clearer_, team::team_info::gold, gold(), gold_, info_, gamemap::is_village(), LOG_NG, gamemap::parse_location_range(), planned_actions_, team::shroud_map::read(), team::team_info::read(), team::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 editor::map_context::load_scenario(), and team_builder::new_team().
|
private |
Definition at line 441 of file team.cpp.
References calculate_is_enemy(), and enemies_.
Referenced by is_enemy().
|
private |
Definition at line 454 of file team.cpp.
References gui2::event::find(), info_, LOG_NGE, team::team_info::side, utils::split(), and team::team_info::team_name.
Referenced by calculate_enemies().
|
inline |
Definition at line 354 of file team.hpp.
References team::team_info::carryover_add, and info_.
Referenced by impl_side_get(), team::team_info::read(), campaign_controller::report_victory(), and team::team_info::write().
|
inline |
Definition at line 356 of file team.hpp.
References team::team_info::carryover_bonus, and info_.
Referenced by impl_side_get(), team::team_info::read(), campaign_controller::report_victory(), and team::team_info::write().
|
inline |
Definition at line 358 of file team.hpp.
References team::team_info::carryover_gold, and info_.
Referenced by team::team_info::read(), campaign_controller::report_victory(), and team::team_info::write().
|
inline |
Definition at line 352 of file team.hpp.
References team::team_info::carryover_percentage, and info_.
Referenced by impl_side_get(), team::team_info::read(), campaign_controller::report_victory(), and team::team_info::write().
|
inline |
Definition at line 275 of file team.hpp.
References team::team_info::controller, and info_.
Referenced by change_controller_by_wml(), editor::map_context::set_side_setup(), and game_board::side_drop_to().
|
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 | ) |
Definition at line 512 of file team.cpp.
References synced_context::ask_server_choice(), change_controller(), resources::controller, ERR_NG, set_local(), and side().
Referenced by impl_side_set(), and game_lua_kernel::intf_modify_side().
|
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 | ||
) |
Definition at line 534 of file team.cpp.
References clear_caches(), t_string::empty(), info_, team::team_info::team_name, and team::team_info::user_team_name.
Referenced by impl_side_set(), game_lua_kernel::intf_modify_side(), and editor::map_context::set_side_setup().
|
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().
|
inline |
Definition at line 320 of file team.hpp.
References team::shroud_map::clear(), fog_, map_location::x, and map_location::y.
Referenced by actions::shroud_clearer::clear_loc(), and game_lua_kernel::intf_toggle_fog().
|
inline |
Definition at line 290 of file team.hpp.
References make_proxy_human().
|
inline |
Definition at line 318 of file team.hpp.
References team::shroud_map::clear(), shroud_, map_location::x, and map_location::y.
Referenced by actions::shroud_clearer::clear_loc(), and game_lua_kernel::intf_shroud_op().
|
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().
|
inline |
Definition at line 256 of file team.hpp.
References team::team_info::controller, and info_.
Referenced by change_controller(), editor::context_manager::edit_side_dialog(), impl_side_get(), side_filter::match_internal(), playsingle_controller::play_side_impl(), team::team_info::read(), and team::team_info::write().
|
inline |
Definition at line 215 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 238 of file team.hpp.
References team::team_info::current_player, and info_.
Referenced by build(), turn_info::process_network_data(), team::team_info::read(), and team::team_info::write().
|
inline |
Definition at line 339 of file team.hpp.
References team::team_info::defeat_condition, and info_.
Referenced by game_board::check_victory(), impl_side_get(), team::team_info::read(), game_board::team_is_defeated(), and team::team_info::write().
|
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().
|
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().
|
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().
|
inline |
Definition at line 302 of file team.hpp.
References team::team_info::flag_icon, and info_.
Referenced by impl_side_get(), team::team_info::read(), REPORT_GENERATOR(), set_flag_icon(), unit_side(), and team::team_info::write().
|
inline |
Definition at line 317 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 575 of file team.cpp.
References ally_fog(), fog_, fog_clearer_, team::shroud_map::shared_value(), shrouded(), team::shroud_map::value(), map_location::x, and map_location::y.
Referenced by attack_info(), actions::shroud_clearer::clear_loc(), image::getMinimap(), unit::is_visible_to_team(), pathfind::mark_route(), terrain_filter::match_internal(), actions::recalculate_fog(), REPORT_GENERATOR(), events::menu_handler::scenario_settings_table(), events::menu_handler::status_table(), pathfind::teleport_map::teleport_map(), time_of_day_at(), and unit_box_at().
|
inline |
Definition at line 337 of file team.hpp.
References team::team_info::disallow_observers, and info_.
Referenced by play_controller::is_team_visible().
|
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().
|
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 | ( | ) |
|
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().
|
static |
Definition at line 828 of file team.cpp.
References get_side_color_range(), and int_to_color().
Referenced by wb::draw_numbers(), and gui2::tmp_change_control::controller::show_sides_list().
|
static |
Definition at line 840 of file team.cpp.
Referenced by wb::manager::create_temp_move(), editor::unit_palette::draw_item(), dialogs::unit_types_preview_pane::get_details(), gui2::get_image_mods(), get_side_color_range(), display::init_flags(), wb::move::move(), gui2::tunit_recruit::pre_show(), dialogs::recall_dialog(), unit_drawer::redraw_unit(), display::reinit_flags_for_side(), REPORT_GENERATOR(), events::menu_handler::scenario_settings_table(), gui2::tunit_preview_pane::set_displayed_type(), editor::mouse_action_unit::set_unit_mouse_overlay(), unit::TC_image_mods(), and unit_side().
|
static |
Definition at line 816 of file team.cpp.
References get_side_color_index(), and game_config::team_rgb_range.
Referenced by display_chat_manager::add_chat_message(), get_minimap_color(), get_side_color(), get_side_highlight(), get_side_highlight_pango(), get_side_rgb(), get_side_rgb_max(), and get_side_rgb_min().
|
static |
Definition at line 853 of file team.cpp.
References get_side_color_range(), and rgb2highlight().
Referenced by mp::get_color_string(), events::menu_handler::scenario_settings_table(), and events::menu_handler::status_table().
|
static |
Definition at line 858 of file team.cpp.
References get_side_color_range(), and rgb2highlight_pango().
Referenced by chat_msg::chat_msg().
|
inlinestatic |
Definition at line 367 of file team.hpp.
References get_side_color_range().
Referenced by events::menu_handler::label_terrain().
|
inlinestatic |
Definition at line 368 of file team.hpp.
References get_side_color_range().
|
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().
|
inline |
Definition at line 194 of file team.hpp.
References gold_.
Referenced by build(), display_context::calculate_team_data(), events::menu_handler::do_recruit(), editor::context_manager::edit_side_dialog(), ai::ai_default_rca::leader_shares_keep_phase::execute(), impl_side_get(), ai_testing::log_turn(), gui2::tunit_recruit::pre_show(), team::team_info::read(), events::menu_handler::recall(), campaign_controller::report_victory(), SYNCED_COMMAND_HANDLER_FUNCTION(), ai::recall_result::test_enough_gold(), ai::recruit_result::test_enough_gold(), and team::team_info::write().
Definition at line 397 of file team.hpp.
References team::team_info::handle_legacy_share_vision(), and info_.
Referenced by game_lua_kernel::intf_modify_side(), and team::team_info::read().
|
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().
|
inline |
Definition at line 344 of file team.hpp.
References team::team_info::hidden, and info_.
Referenced by editor::context_manager::edit_side_dialog(), impl_side_get(), team::team_info::read(), gui2::tlabel_settings::tlabel_settings(), and team::team_info::write().
team::human | ( | PROXY_AI | , |
"ai" | |||
) |
|
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().
|
inline |
Definition at line 284 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 is_local(), is_network(), play_controller::is_team_visible(), play_controller::play_turn(), and user_choice_manager::user_choice_manager().
|
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().
|
inline |
Definition at line 264 of file team.hpp.
References team::team_info::controller, and info_.
Referenced by is_local_human(), is_network_human(), knows_about_team(), and game_board::side_change_controller().
|
inline |
Definition at line 285 of file team.hpp.
References info_, and team::team_info::proxy_controller.
Referenced by play_controller::is_team_visible().
|
inline |
Definition at line 261 of file team.hpp.
References info_, is_empty(), and team::team_info::is_local.
Referenced by is_local_ai(), is_local_human(), play_controller::maybe_do_init_side(), turn_info::process_network_data(), and team::team_info::read().
|
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().
|
inline |
Definition at line 267 of file team.hpp.
References is_human(), and is_local().
Referenced by play_controller::can_use_synced_wml_menu(), play_controller::is_browsing(), play_controller::is_team_visible(), wb::manager::on_change_controller(), and turn_info::process_network_data().
|
inline |
Definition at line 262 of file team.hpp.
References info_, is_empty(), and team::team_info::is_local.
Referenced by is_network_ai(), is_network_human(), wb::manager::on_change_controller(), and playsingle_controller::should_return_to_play_side().
|
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().
|
inline |
Definition at line 269 of file team.hpp.
References is_human(), and is_network().
|
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 |
Definition at line 615 of file team.cpp.
References is_enemy(), is_human(), share_maps(), share_view(), uses_fog(), and uses_shroud().
Referenced by events::menu_handler::scenario_settings_table(), and events::menu_handler::status_table().
|
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().
|
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 | ) |
|
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().
|
inline |
Definition at line 274 of file team.hpp.
References team::team_info::controller, and info_.
|
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") | |||
) |
|
inline |
Definition at line 273 of file team.hpp.
References team::team_info::controller, and info_.
Referenced by playsingle_controller::play_ai_turn().
|
inline |
Definition at line 288 of file team.hpp.
References info_, and team::team_info::proxy_controller.
|
inline |
Definition at line 289 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 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 |
Definition at line 420 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 209 of file team.hpp.
References gold_, and total_income().
Referenced by play_controller::do_init_side().
|
inline |
Definition at line 338 of file team.hpp.
References info_, and team::team_info::no_leader.
Referenced by editor::context_manager::edit_side_dialog(), team::team_info::read(), and team::team_info::write().
|
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().
|
inline |
Definition at line 244 of file team.hpp.
References info_, and team::team_info::objectives.
Referenced by playsingle_controller::check_objectives(), impl_side_get(), events::menu_handler::objectives(), team_builder::objectives(), team::team_info::read(), and team::team_info::write().
|
inline |
Definition at line 245 of file team.hpp.
References info_, and team::team_info::objectives_changed.
Referenced by playsingle_controller::check_objectives(), impl_side_get(), team::team_info::read(), and team::team_info::write().
|
inline |
Definition at line 190 of file team.hpp.
References villages_.
Referenced by actions::get_village(), image::getMinimap(), ai::helper_check_village(), pathfind::mark_route(), wb::path_cost(), and editor::editor_action_village::perform().
|
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().
|
inline |
Definition at line 319 of file team.hpp.
References team::shroud_map::place(), shroud_, map_location::x, and map_location::y.
Referenced by game_lua_kernel::intf_shroud_op().
|
inline |
Definition at line 282 of file team.hpp.
References info_, and team::team_info::proxy_controller.
Referenced by playsingle_controller::play_side_impl().
|
inline |
Definition at line 198 of file team.hpp.
References info_, and team::team_info::recall_cost.
Referenced by wb::recall::execute(), ai::default_recruitment::recruitment::get_cheapest_unit_cost_for_leader(), impl_side_get(), team::team_info::read(), events::menu_handler::recall(), actions::recall_unit(), ai::simulated_recall(), ai::recall_result::test_enough_gold(), actions::undo::recall_action::undo(), and team::team_info::write().
|
inline |
Definition at line 220 of file team.hpp.
References recall_list_.
Referenced by unit_creator::add_unit(), carryover::carryover(), ai::readonly_context_impl::get_recall_list(), ai::recall_result::get_recall_unit(), ai::formula_ai::get_value(), team_builder::handle_unit(), game_lua_kernel::intf_erase_unit(), game_lua_kernel::intf_extract_unit(), game_lua_kernel::intf_match_unit(), game_lua_kernel::intf_put_recall_unit(), side_filter::match_internal(), events::menu_handler::recall(), actions::recall_unit(), actions::undo::dismiss_action::redo(), actions::undo::recall_action::redo(), ai::simulated_recall(), SYNCED_COMMAND_HANDLER_FUNCTION(), actions::undo::dismiss_action::undo(), and actions::undo::recall_action::undo().
|
inline |
Definition at line 221 of file team.hpp.
References recall_list_.
|
inline |
Definition at line 228 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_cheapest_unit_cost_for_leader(), ai::default_recruitment::recruitment::get_cost_map_of_side(), actions::get_recruits(), ai::formula_ai::get_value(), impl_side_get(), team::team_info::read(), set_recruits(), and ai::default_recruitment::recruitment::update_average_local_cost().
|
inline |
Definition at line 322 of file team.hpp.
References fog_, and team::shroud_map::reset().
Referenced by game_lua_kernel::intf_modify_side(), game_lua_kernel::intf_toggle_fog(), and 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 644 of file team.cpp.
References fog_clearer_.
Referenced by game_lua_kernel::intf_toggle_fog().
|
inline |
Definition at line 242 of file team.hpp.
References info_, and team::team_info::objectives_changed.
Referenced by playsingle_controller::check_objectives(), and events::menu_handler::objectives().
|
inline |
Definition at line 321 of file team.hpp.
References team::shroud_map::reset(), and shroud_.
Referenced by game_lua_kernel::intf_modify_side().
|
inline |
Definition at line 236 of file team.hpp.
References info_, and team::team_info::save_id.
Referenced by impl_side_get(), game_lua_kernel::intf_match_unit(), side_filter::match_internal(), events::save_id_matches::operator()(), team::team_info::read(), set_save_id(), events::menu_handler::show_statistics(), and team::team_info::write().
Definition at line 219 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::get_village(), actions::undo::recruit_action::redo(), actions::shroud_clearing_action::return_village(), actions::shroud_clearing_action::take_village(), and actions::undo::recruit_action::undo().
|
inline |
Definition at line 336 of file team.hpp.
References auto_shroud_updates_.
Referenced by SYNCED_COMMAND_HANDLER_FUNCTION().
Definition at line 214 of file team.hpp.
References game_config::base_income, team::team_info::income, and info_.
Referenced by impl_side_set(), game_lua_kernel::intf_modify_side(), and editor::map_context::set_side_setup().
|
inline |
Definition at line 353 of file team.hpp.
References team::team_info::carryover_add, and info_.
Referenced by impl_side_set().
|
inline |
Definition at line 355 of file team.hpp.
References team::team_info::carryover_bonus, and info_.
Referenced by impl_side_set().
Definition at line 357 of file team.hpp.
References team::team_info::carryover_gold, and info_.
Definition at line 351 of file team.hpp.
References team::team_info::carryover_percentage, and info_.
Referenced by impl_side_set().
|
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().
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().
|
inline |
Definition at line 222 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 340 of file team.hpp.
References team::team_info::defeat_condition, and info_.
|
inline |
sets the defeat condition if
value | is 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().
|
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().
|
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().
|
inline |
Definition at line 324 of file team.hpp.
References fog_, and team::shroud_map::set_enabled().
Referenced by game_lua_kernel::intf_modify_side(), editor::map_context::set_side_setup(), and SYNCED_COMMAND_HANDLER_FUNCTION().
Definition at line 211 of file team.hpp.
Referenced by impl_side_set(), game_lua_kernel::intf_modify_side(), and editor::map_context::set_side_setup().
|
inline |
Definition at line 345 of file team.hpp.
References team::team_info::hidden, and info_.
Referenced by impl_side_set(), game_lua_kernel::intf_modify_side(), editor::map_context::new_side(), and editor::map_context::set_side_setup().
|
inline |
Definition at line 272 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 348 of file team.hpp.
References info_, and team::team_info::lost.
Referenced by impl_side_set().
|
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().
Definition at line 560 of file team.cpp.
References info_, team::team_info::objectives, and team::team_info::objectives_changed.
Referenced by impl_side_set(), and team_builder::objectives().
|
inline |
Definition at line 241 of file team.hpp.
References c, info_, and team::team_info::objectives_changed.
Referenced by impl_side_set().
|
inline |
Definition at line 347 of file team.hpp.
References info_, and team::team_info::persistent.
Referenced by impl_side_set().
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 | ) |
Definition at line 406 of file team.cpp.
References team::team_info::can_recruit, info_, team::team_info::minimum_recruit_price, ai::manager::raise_recruit_list_changed(), and recruits().
Referenced by impl_side_set(), and game_lua_kernel::intf_modify_side().
|
inline |
Definition at line 237 of file team.hpp.
References info_, team::team_info::save_id, and save_id().
|
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().
|
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().
|
inline |
Definition at line 395 of file team.hpp.
References info_, and team::team_info::share_vision.
|
inline |
Definition at line 323 of file team.hpp.
References team::shroud_map::set_enabled(), and shroud_.
Referenced by game_lua_kernel::intf_modify_side(), editor::map_context::set_side_setup(), and SYNCED_COMMAND_HANDLER_FUNCTION().
Definition at line 212 of file team.hpp.
References amount, info_, and team::team_info::start_gold.
Definition at line 199 of file team.hpp.
References team::team_info::income_per_village, and info_.
Referenced by impl_side_set(), game_lua_kernel::intf_modify_side(), and editor::map_context::set_side_setup().
support | The 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().
|
inline |
Definition at line 386 of file team.hpp.
References info_, compression::NONE, and team::team_info::share_vision.
Referenced by knows_about_team().
|
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().
|
inline |
Definition at line 388 of file team.hpp.
References info_, and team::team_info::share_vision.
Referenced by editor::context_manager::edit_side_dialog(), team::team_info::handle_legacy_share_vision(), impl_side_get(), team::team_info::read(), and team::team_info::write().
bool team::shrouded | ( | const map_location & | loc | ) | const |
Definition at line 567 of file team.cpp.
References ally_shroud(), team::shroud_map::shared_value(), shroud_, team::shroud_map::value(), map_location::x, and map_location::y.
Referenced by game_state::can_recruit_on(), pathfind::shortest_path_calculator::cost(), pathfind::move_type_path_calculator::cost(), pathfind::find_vacant_tile(), fogged(), image::getMinimap(), terrain_filter::match_internal(), REPORT_GENERATOR(), time_of_day_at(), and unit_box_at().
|
inline |
Definition at line 193 of file team.hpp.
References info_, and team::team_info::side.
Referenced by unit_creator::add_unit(), change_controller_by_wml(), check_side_number(), ai::default_recruitment::recruitment::do_combat_analysis(), ai::default_recruitment::recruitment::execute(), unit_creator::find_location(), ai::default_recruitment::recruitment::get_unit_ratio(), impl_side_get(), side_filter::match_internal(), playsingle_controller::play_side_impl(), gui2::tunit_recruit::pre_show(), team::team_info::read(), SYNCED_COMMAND_HANDLER_FUNCTION(), actions::shroud_clearing_action::take_village(), game_board::team_is_defeated(), ai::default_recruitment::recruitment::update_important_hexes(), and team::team_info::write().
|
inline |
Definition at line 307 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 team::team_info::read(), REPORT_GENERATOR(), events::menu_handler::show_statistics(), gui2::tlabel_settings::tlabel_settings(), unit_side(), and team::team_info::write().
Definition at line 213 of file team.hpp.
Referenced by play_controller::do_init_side(), ai::simulated_recall(), SYNCED_COMMAND_HANDLER_FUNCTION(), actions::undo::recruit_action::undo(), and actions::undo::recall_action::undo().
|
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().
|
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().
|
inline |
Definition at line 297 of file team.hpp.
References info_, and team::team_info::team_name.
Referenced by editor::context_manager::edit_side_dialog(), impl_side_get(), impl_side_set(), game_lua_kernel::intf_modify_side(), side_filter::match_internal(), display::parse_team_overlays(), team::team_info::read(), map_labels::team_name(), and team::team_info::write().
config team::to_config | ( | ) | const |
Definition at line 872 of file team.cpp.
References config::add_child(), and write().
|
inline |
Definition at line 294 of file team.hpp.
References info_, and team::team_info::proxy_controller.
|
inline |
Definition at line 295 of file team.hpp.
References info_, and team::team_info::proxy_controller.
|
inline |
Definition at line 201 of file team.hpp.
References base_income(), team::team_info::income_per_village, info_, and villages_.
Referenced by display_context::calculate_team_data(), ai::ai_default_rca::leader_shares_keep_phase::execute(), impl_side_get(), ai_testing::log_turn(), and new_turn().
|
inline |
Definition at line 298 of file team.hpp.
References info_, and team::team_info::user_team_name.
Referenced by display_context::calculate_team_data(), editor::context_manager::edit_side_dialog(), editor::context_manager::expand_sides_menu(), impl_side_get(), impl_side_set(), team::team_info::read(), gui2::tlabel_settings::tlabel_settings(), and team::team_info::write().
|
inline |
Definition at line 316 of file team.hpp.
References team::shroud_map::enabled(), and fog_.
Referenced by build(), actions::clear_shroud(), editor::context_manager::edit_side_dialog(), fog_or_shroud(), impl_side_get(), knows_about_team(), actions::recalculate_fog(), events::menu_handler::status_table(), SYNCED_COMMAND_HANDLER_FUNCTION(), and write().
|
inline |
Definition at line 315 of file team.hpp.
References team::shroud_map::enabled(), and shroud_.
Referenced by build(), actions::clear_shroud(), editor::context_manager::edit_side_dialog(), pathfind::find_vacant_tile(), fog_or_shroud(), impl_side_get(), knows_about_team(), REPORT_GENERATOR(), events::menu_handler::status_table(), SYNCED_COMMAND_HANDLER_FUNCTION(), and write().
|
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().
|
inline |
Definition at line 360 of file team.hpp.
References info_, and team::team_info::variables.
|
inline |
Definition at line 197 of file team.hpp.
References team::team_info::income_per_village, and info_.
Referenced by editor::context_manager::edit_side_dialog(), and impl_side_get().
|
inline |
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().
|
inline |
Definition at line 189 of file team.hpp.
References villages_.
Referenced by display_context::calculate_team_data(), ai::default_recruitment::recruitment::get_estimated_income(), ai_testing::log_turn(), and play_controller::play_turn().
Definition at line 355 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_, team::shroud_map::write(), team::team_info::write(), and write_location_range().
Referenced by impl_side_get(), and to_config().
|
private |
Definition at line 419 of file team.hpp.
Referenced by action_bonus_count(), build(), set_action_bonus_count(), and write().
|
mutableprivate |
Definition at line 428 of file team.hpp.
Referenced by ally_fog().
|
mutableprivate |
Definition at line 428 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 180 of file team.hpp.
Referenced by team_builder::handle_leader().
|
private |
Definition at line 414 of file team.hpp.
Referenced by auto_shroud_updates(), build(), set_auto_shroud_updates(), and write().
|
mutableprivate |
Definition at line 418 of file team.hpp.
Referenced by build(), countdown_time(), set_countdown_time(), and write().
|
staticprivate |
Definition at line 172 of file team.hpp.
Referenced by team::team_info::read().
|
mutableprivate |
Definition at line 426 of file team.hpp.
Referenced by calculate_enemies(), and is_enemy().
|
private |
Definition at line 410 of file team.hpp.
Referenced by ally_fog(), 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 412 of file team.hpp.
Referenced by add_fog_override(), build(), fogged(), remove_fog_override(), and write().
|
private |
Definition at line 407 of file team.hpp.
Referenced by build(), gold(), new_turn(), set_gold(), spend_gold(), and write().
|
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().
|
private |
Definition at line 422 of file team.hpp.
Referenced by last_recruit().
|
private |
Whiteboard planned actions for this team.
Definition at line 433 of file team.hpp.
Referenced by build(), and get_side_actions().
|
private |
Definition at line 421 of file team.hpp.
Referenced by recall_list().
|
private |
Definition at line 410 of file team.hpp.
Referenced by ally_shroud(), build(), clear_shroud(), merge_shroud_map_data(), place_shroud(), reshroud(), set_shroud(), shrouded(), uses_shroud(), and write().
|
private |
Definition at line 408 of file team.hpp.
Referenced by build(), clear_villages(), get_village(), lose_village(), owns_village(), support(), total_income(), villages(), and write().