Public Types | Public Member Functions | Private Member Functions | Private Attributes

unit_type_data Class Reference

#include <unit_types.hpp>

Collaboration diagram for unit_type_data:
Collaboration graph
[legend]

List of all members.

Public Types

typedef std::map< std::string,
unit_type
unit_type_map

Public Member Functions

 unit_type_data ()
const unit_type_maptypes () const
const race_mapraces () const
const config::const_child_itors traits () const
void set_config (config &cfg)
const unit_typefind (const std::string &key, unit_type::BUILD_STATUS status=unit_type::FULL) const
void check_types (const std::vector< std::string > &types) const
const unit_racefind_race (const std::string &) const
void build_all (unit_type::BUILD_STATUS status)
bool hide_help (const std::string &type_id, const std::string &race_id) const
 Checks if the [hide_help] tag contains these IDs.

Private Member Functions

 unit_type_data (const unit_type_data &)
void read_hide_help (const config &cfg)
 Parses the [hide_help] tag.
void set_unit_config (const config &unit_cfg)
const configfind_config (const std::string &key) const
std::pair
< unit_type_map::iterator,
bool > 
insert (const std::pair< std::string, unit_type > &utype)
void clear ()
unit_typebuild_unit_type (const unit_type_map::iterator &ut, unit_type::BUILD_STATUS status) const
void add_advancefrom (const config &unit_cfg) const
void add_advancement (unit_type &to_unit) const

Private Attributes

unit_type_map types_
movement_type_map movement_types_
race_map races_
bool hide_help_all_
 True if [hide_help] contains a 'all=yes' at its root.
std::vector< std::set
< std::string > > 
hide_help_type_
std::vector< std::set
< std::string > > 
hide_help_race_
const configunit_cfg_
unit_type::BUILD_STATUS build_status_

Detailed Description

Definition at line 363 of file unit_types.hpp.


Member Typedef Documentation

typedef std::map<std::string,unit_type> unit_type_data::unit_type_map

Definition at line 368 of file unit_types.hpp.


Constructor & Destructor Documentation

unit_type_data::unit_type_data (  ) 

Definition at line 1125 of file unit_types.cpp.

unit_type_data::unit_type_data ( const unit_type_data  )  [private]

Member Function Documentation

void unit_type_data::add_advancefrom ( const config unit_cfg  )  const [private]
void unit_type_data::add_advancement ( unit_type to_unit  )  const [private]

Definition at line 1340 of file unit_types.cpp.

References config::child_range(), DBG_UT, error(), unit_type::get_cfg(), unit_type::id(), and types_.

Referenced by build_all().

Here is the call graph for this function:

Here is the caller graph for this function:

void unit_type_data::build_all ( unit_type::BUILD_STATUS  status  ) 
unit_type & unit_type_data::build_unit_type ( const unit_type_map::iterator &  ut,
unit_type::BUILD_STATUS  status 
) const [private]

Definition at line 1275 of file unit_types.cpp.

References config::child_range(), unit_type::CREATED, DBG_UT, unit_type::HELP_INDEX, movement_types_, races_, and unit_cfg_.

Referenced by build_all(), and find().

Here is the call graph for this function:

Here is the caller graph for this function:

void unit_type_data::check_types ( const std::vector< std::string > &  types  )  const

Definition at line 1227 of file unit_types.cpp.

References find(), and type.

Referenced by unit::set_advances_to(), and unit::set_recruits().

Here is the call graph for this function:

Here is the caller graph for this function:

void unit_type_data::clear (  )  [private]

Definition at line 1247 of file unit_types.cpp.

References build_status_, hide_help_all_, hide_help_race_, hide_help_type_, movement_types_, races_, and types_.

Referenced by set_config().

Here is the caller graph for this function:

const unit_type * unit_type_data::find ( const std::string &  key,
unit_type::BUILD_STATUS  status = unit_type::FULL 
) const

Definition at line 1205 of file unit_types.cpp.

References build_unit_type(), DBG_CF, and types_.

Referenced by unit::add_modification(), advancement_tree_internal(), unit::advances_to_translated(), ai::testing_ai_default::recruitment_phase::analyze_potential_recruit_combat(), ai::ai_default_recruitment_stage::analyze_potential_recruit_combat(), ai::ai_default_recruitment_stage::analyze_potential_recruit_movements(), check_types(), wb::recruit::create_corresponding_unit(), events::menu_handler::create_unit(), events::menu_handler::create_unit_2(), events::console_handler::do_create(), events::menu_handler::do_recruit(), do_replay_handle(), mp::wait::leader_preview_pane::draw_contents(), mp::wait::generate_menu(), unit::generate_traits(), get_advanced_unit(), ai::ai_default_recruitment_stage::get_combat_score_vs(), dialogs::unit_types_preview_pane::get_details(), get_unit_type(), ai::formula_ai::get_value(), impl_unit_type_get(), intf_add_known_unit(), intf_transform_unit(), help::make_unit_link(), team::minimum_recruit_price(), help::unit_topic_generator::operator()(), ai::testing_ai_default::potential_recruit_converter::operator()(), ai::unit_combat_score_getter::operator()(), leader_list_manager::populate_leader_combo(), gui2::tunit_create::pre_show(), wb::recruit::recruit(), events::menu_handler::recruit(), ai::testing_ai_default::recruitment_phase::recruit_usage(), ai::ai_default_recruitment_stage::recruit_usage(), mp::connect::side::resolve_random(), mp::connect::side::side(), attack::unit_killed(), leader_list_manager::update_gender_list(), and unit::write().

Here is the call graph for this function:

Here is the caller graph for this function:

const config & unit_type_data::find_config ( const std::string &  key  )  const [private]

Definition at line 1234 of file unit_types.cpp.

References ERR_CF, error(), config::find_child(), and unit_cfg_.

Referenced by set_config().

Here is the call graph for this function:

Here is the caller graph for this function:

const unit_race * unit_type_data::find_race ( const std::string &  key  )  const
bool unit_type_data::hide_help ( const std::string &  type_id,
const std::string &  race_id 
) const

Checks if the [hide_help] tag contains these IDs.

Definition at line 1325 of file unit_types.cpp.

References preferences::editor::TransitionUpdateMode::count, hide_help_all_, hide_help_race_, and hide_help_type_.

Referenced by unit_type::hide_help(), and set_config().

Here is the caller graph for this function:

std::pair<unit_type_map::iterator, bool> unit_type_data::insert ( const std::pair< std::string, unit_type > &  utype  )  [inline, private]

Definition at line 393 of file unit_types.hpp.

References types_.

Referenced by set_config().

Here is the caller graph for this function:

const race_map& unit_type_data::races (  )  const [inline]

Definition at line 371 of file unit_types.hpp.

References races_.

Referenced by LuaKernel::initialize(), read_hide_help(), and editor::unit_palette::setup().

Here is the caller graph for this function:

void unit_type_data::read_hide_help ( const config cfg  )  [private]

Parses the [hide_help] tag.

Definition at line 1297 of file unit_types.cpp.

References config::child(), hide_help_race_, hide_help_type_, races(), utils::split(), types(), and types_.

Referenced by set_config().

Here is the call graph for this function:

Here is the caller graph for this function:

void unit_type_data::set_config ( config cfg  ) 
void unit_type_data::set_unit_config ( const config unit_cfg  )  [inline, private]

Definition at line 390 of file unit_types.hpp.

References unit_cfg_.

Referenced by set_config().

Here is the caller graph for this function:

const config::const_child_itors unit_type_data::traits (  )  const [inline]

Definition at line 372 of file unit_types.hpp.

References config::child_range(), and unit_cfg_.

Referenced by intf_get_traits().

Here is the call graph for this function:

Here is the caller graph for this function:

const unit_type_map& unit_type_data::types (  )  const [inline]

Member Data Documentation

Definition at line 411 of file unit_types.hpp.

Referenced by build_all(), and clear().

True if [hide_help] contains a 'all=yes' at its root.

Definition at line 405 of file unit_types.hpp.

Referenced by clear(), hide_help(), and set_config().

std::vector< std::set<std::string> > unit_type_data::hide_help_race_ [private]

Definition at line 408 of file unit_types.hpp.

Referenced by clear(), hide_help(), and read_hide_help().

std::vector< std::set<std::string> > unit_type_data::hide_help_type_ [private]

Definition at line 407 of file unit_types.hpp.

Referenced by clear(), hide_help(), and read_hide_help().

Definition at line 401 of file unit_types.hpp.

Referenced by build_unit_type(), clear(), and set_config().

Definition at line 402 of file unit_types.hpp.

Referenced by build_unit_type(), clear(), find_race(), races(), and set_config().

Definition at line 400 of file unit_types.hpp.

Referenced by add_advancement(), build_all(), clear(), find(), insert(), read_hide_help(), and types().

Definition at line 410 of file unit_types.hpp.

Referenced by build_all(), build_unit_type(), find_config(), set_unit_config(), and traits().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Thu May 24 2012 01:17:46 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs