#include <create_engine.hpp>
Classes | |
struct | extras_metadata |
Public Types | |
enum | MP_EXTRA { ERA, MOD } |
typedef boost::shared_ptr < extras_metadata > | extras_metadata_ptr |
typedef boost::shared_ptr< level > | level_ptr |
typedef boost::shared_ptr < scenario > | scenario_ptr |
typedef boost::shared_ptr < user_map > | user_map_ptr |
typedef boost::shared_ptr < random_map > | random_map_ptr |
typedef boost::shared_ptr < campaign > | campaign_ptr |
Private Member Functions | |
create_engine (const create_engine &) | |
void | operator= (const create_engine &) |
void | init_all_levels () |
void | init_extras (const MP_EXTRA extra_type) |
void | apply_level_filters () |
size_t | map_level_index (size_t index) const |
Definition at line 179 of file create_engine.hpp.
Definition at line 200 of file create_engine.hpp.
Definition at line 194 of file create_engine.hpp.
Definition at line 196 of file create_engine.hpp.
Definition at line 199 of file create_engine.hpp.
Definition at line 197 of file create_engine.hpp.
Definition at line 198 of file create_engine.hpp.
Enumerator | |
---|---|
ERA | |
MOD |
Definition at line 185 of file create_engine.hpp.
ng::create_engine::create_engine | ( | CVideo & | v, |
saved_game & | state | ||
) |
Definition at line 390 of file create_engine.cpp.
References mp_game_settings::active_mods, saved_game::classification(), network::connect(), current_level_type_, DBG_MP, dependency_manager_, ERA, filesystem::FILE_NAME_ONLY, game_config_manager::get(), filesystem::get_files_in_dir(), filesystem::get_user_data_dir(), init_all_levels(), init_extras(), game_config_manager::load_game_config_for_create(), MOD, preferences::modifications(), saved_game::mp_settings(), reset_level_filters(), mp_game_settings::saved_game, mp_game_settings::show_connect, state_, user_map_names_, user_scenario_names_, and video_.
ng::create_engine::~create_engine | ( | ) |
Definition at line 453 of file create_engine.cpp.
|
private |
std::vector< std::string > & ng::create_engine::active_mods | ( | ) |
Definition at line 965 of file create_engine.cpp.
References mp_game_settings::active_mods, saved_game::mp_settings(), and state_.
Referenced by gui2::tcampaign_selection::post_show(), gui2::tcampaign_selection::pre_show(), prepare_for_era_and_mods(), gui2::tcampaign_settings::update_lists(), and mp::create::~create().
void ng::create_engine::apply_level_filter | ( | const std::string & | name | ) |
Definition at line 646 of file create_engine.cpp.
References apply_level_filters(), and level_name_filter_.
Referenced by mp::create::process_event_impl().
Definition at line 652 of file create_engine.cpp.
References apply_level_filters(), and player_count_filter_.
|
private |
Definition at line 1121 of file create_engine.cpp.
References campaigns_, campaigns_filtered_, i, level_name_filter_, player_count_filter_, random_maps_, random_maps_filtered_, scenarios_, scenarios_filtered_, sp_campaigns_, sp_campaigns_filtered_, user_maps_, user_maps_filtered_, user_scenarios_, and user_scenarios_filtered_.
Referenced by apply_level_filter().
size_t ng::create_engine::current_era_index | ( | ) | const |
Definition at line 827 of file create_engine.cpp.
References current_era_index_.
Referenced by gui2::tcampaign_settings::update_lists().
const create_engine::extras_metadata & ng::create_engine::current_extra | ( | const MP_EXTRA | extra_type | ) | const |
Definition at line 756 of file create_engine.cpp.
References current_era_index_, current_mod_index_, ERA, and get_const_extras_by_type().
Referenced by mp::create::process_event_impl(), and mp::create::~create().
level & ng::create_engine::current_level | ( | ) | const |
Definition at line 731 of file create_engine.cpp.
References campaigns_, current_level_index_, current_level_type_, random_maps_, ng::depcheck::SCENARIO, scenarios_, sp_campaigns_, user_maps_, and user_scenarios_.
Referenced by mp::create::draw_level_image(), get_parameters(), mp::get_selected_helper(), mp::create::hide_children(), init_generated_level_data(), mp::create::init_level_changed(), gui2::tcampaign_settings::pre_show(), prepare_for_campaign(), prepare_for_other(), prepare_for_scenario(), mp::create::process_event_impl(), select_campaign_difficulty(), set_current_level(), mp::create::synchronize_selections(), gui2::tcampaign_settings::update_lists(), and mp::create::~create().
level::TYPE ng::create_engine::current_level_type | ( | ) | const |
Definition at line 770 of file create_engine.cpp.
References current_level_type_.
Referenced by mp::get_selected_helper(), mp::create::process_event_impl(), set_current_level(), mp::create::synchronize_selections(), and mp::create::~create().
size_t ng::create_engine::current_mod_index | ( | ) | const |
Definition at line 832 of file create_engine.cpp.
References current_mod_index_.
const depcheck::manager & ng::create_engine::dependency_manager | ( | ) | const |
Definition at line 955 of file create_engine.cpp.
References dependency_manager_.
Referenced by mp::create::synchronize_selections(), and mp::create::update_mod_menu().
std::vector< std::string > ng::create_engine::extras_menu_item_names | ( | const MP_EXTRA | extra_type, |
bool | escape_markup = true |
||
) | const |
Definition at line 715 of file create_engine.cpp.
References get_const_extras_by_type(), and font::NULL_MARKUP.
Referenced by mp::create::create(), mp::create::layout_children(), and gui2::tcampaign_settings::update_lists().
int ng::create_engine::find_extra_by_id | ( | const MP_EXTRA | extra_type, |
const std::string & | id | ||
) | const |
Definition at line 911 of file create_engine.cpp.
References get_const_extras_by_type(), and i.
Referenced by mp::create::create().
int ng::create_engine::find_level_by_id | ( | const std::string & | id | ) | const |
Definition at line 858 of file create_engine.cpp.
References campaigns_, i, ng::level::id(), ng::user_map::id(), ng::random_map::id(), ng::campaign::id(), random_maps_, scenarios_, sp_campaigns_, user_maps_, and user_scenarios_.
Referenced by mp::create::create(), mp::find_helper(), and mp::create::synchronize_selections().
level::TYPE ng::create_engine::find_level_type_by_id | ( | const std::string & | id | ) | const |
Definition at line 925 of file create_engine.cpp.
References campaigns_, ng::level::id(), ng::user_map::id(), ng::random_map::id(), ng::campaign::id(), random_maps_, ng::depcheck::SCENARIO, scenarios_, user_maps_, and user_scenarios_.
Referenced by mp::find_helper(), and mp::create::synchronize_selections().
bool ng::create_engine::generator_assigned | ( | ) | const |
Definition at line 848 of file create_engine.cpp.
References generator_.
Referenced by mp::create::process_event_impl().
Definition at line 853 of file create_engine.cpp.
References generator_.
Referenced by mp::create::process_event_impl().
const std::vector< create_engine::extras_metadata_ptr > & ng::create_engine::get_const_extras_by_type | ( | const MP_EXTRA | extra_type | ) | const |
Definition at line 1261 of file create_engine.cpp.
References ERA, eras_, and mods_.
Referenced by current_extra(), extras_menu_item_names(), find_extra_by_id(), gui2::tcampaign_selection::pre_show(), and gui2::tcampaign_settings::update_lists().
std::vector< create_engine::extras_metadata_ptr > & ng::create_engine::get_extras_by_type | ( | const MP_EXTRA | extra_type | ) |
Definition at line 1267 of file create_engine.cpp.
References ERA, eras_, and mods_.
Referenced by init_extras().
std::vector< create_engine::level_ptr > ng::create_engine::get_levels_by_type | ( | level::TYPE | type | ) | const |
Definition at line 1221 of file create_engine.cpp.
References campaigns_, campaigns_filtered_, random_maps_, random_maps_filtered_, ng::depcheck::SCENARIO, scenarios_, scenarios_filtered_, sp_campaigns_, sp_campaigns_filtered_, user_maps_, user_maps_filtered_, user_scenarios_, and user_scenarios_filtered_.
Referenced by levels_menu_item_names().
std::vector< create_engine::level_ptr > ng::create_engine::get_levels_by_type_unfiltered | ( | level::TYPE | type | ) | const |
Definition at line 1182 of file create_engine.cpp.
References campaigns_, random_maps_, ng::depcheck::SCENARIO, scenarios_, sp_campaigns_, user_maps_, and user_scenarios_.
Referenced by mp::create::create(), sp::enter_create_mode(), and gui2::tcampaign_selection::pre_show().
const mp_game_settings & ng::create_engine::get_parameters | ( | ) |
Definition at line 970 of file create_engine.cpp.
References ng::level::allow_era_choice(), current_era_index_, current_level(), DBG_MP, eras_, mp_game_settings::mp_era, saved_game::mp_settings(), and state_.
Referenced by sp::enter_create_mode(), mp::create::get_parameters(), and prepare_for_era_and_mods().
saved_game & ng::create_engine::get_state | ( | ) |
Definition at line 1272 of file create_engine.cpp.
References state_.
Referenced by gui2::tcampaign_settings::post_show(), gui2::tcampaign_settings::pre_show(), and mp::create::process_event_impl().
void ng::create_engine::init_active_mods | ( | ) |
Definition at line 960 of file create_engine.cpp.
References mp_game_settings::active_mods, dependency_manager_, saved_game::mp_settings(), and state_.
Referenced by mp::create::synchronize_selections().
|
private |
Definition at line 980 of file create_engine.cpp.
References _(), campaigns_, saved_game::classification(), dependency_manager_, e, ERR_CF, game_config_manager::get(), filesystem::get_user_data_dir(), i, ng::less_campaigns_rank(), game::error::message, preprocess_file(), random_maps_, read(), filesystem::read_map(), ng::depcheck::SCENARIO, scenarios_, sp_campaigns_, state_, user_map_names_, user_maps_, user_scenario_names_, and user_scenarios_.
Referenced by create_engine().
Definition at line 1099 of file create_engine.cpp.
References config::child_range(), saved_game::classification(), ERA, game_config_manager::game_config(), game_config_manager::get(), get_extras_by_type(), and state_.
Referenced by create_engine().
void ng::create_engine::init_generated_level_data | ( | ) |
Definition at line 457 of file create_engine.cpp.
References current_level(), ng::level::data(), DBG_MP, e, ng::random_map::generate_whole_scenario(), generator_, config::has_attribute(), ng::level::set_data(), game::error::what(), and WRN_MP.
Referenced by mp::create::process_event_impl().
const std::string & ng::create_engine::level_name_filter | ( | ) | const |
Definition at line 693 of file create_engine.cpp.
References level_name_filter_.
Referenced by mp::create::process_event_impl().
std::vector< std::string > ng::create_engine::levels_menu_item_names | ( | ) | const |
Definition at line 703 of file create_engine.cpp.
References current_level_type_, get_levels_by_type(), HELP_STRING_SEPARATOR, ng::level::icon(), IMAGE_PREFIX, IMG_TEXT_SEPARATOR, and ng::level::name().
Referenced by mp::create::init_level_type_changed(), mp::create::layout_children(), and mp::create::synchronize_selections().
|
private |
|
private |
int ng::create_engine::player_num_filter | ( | ) | const |
Definition at line 698 of file create_engine.cpp.
References player_count_filter_.
Referenced by mp::create::process_event_impl().
void ng::create_engine::prepare_for_campaign | ( | const std::string & | difficulty | ) |
Definition at line 543 of file create_engine.cpp.
References game_classification::abbrev, game_classification::campaign, game_classification::campaign_define, game_classification::campaign_xtra_defines, saved_game::classification(), current_level(), ng::level::data(), DBG_MP, game_classification::difficulty, game_classification::end_text, game_classification::end_text_duration, saved_game::set_carryover_sides_start(), utils::split(), and state_.
Referenced by sp::enter_create_mode(), and mp::create::process_event_impl().
void ng::create_engine::prepare_for_era_and_mods | ( | ) |
Definition at line 519 of file create_engine.cpp.
References active_mods(), saved_game::classification(), game_classification::era_define, config::find_child(), game_config_manager::game_config(), game_config_manager::get(), get_parameters(), game_classification::mod_defines, and state_.
Referenced by sp::enter_create_mode(), and mp::create::process_event_impl().
void ng::create_engine::prepare_for_new_level | ( | ) |
Definition at line 512 of file create_engine.cpp.
References DBG_MP, saved_game::expand_random_scenario(), saved_game::expand_scenario(), and state_.
Referenced by sp::enter_create_mode(), and mp::create::process_event_impl().
void ng::create_engine::prepare_for_other | ( | ) |
Definition at line 639 of file create_engine.cpp.
References current_level(), ng::level::data(), DBG_MP, mp_game_settings::hash, config::hash(), saved_game::mp_settings(), saved_game::set_scenario(), and state_.
Referenced by mp::create::process_event_impl().
void ng::create_engine::prepare_for_saved_game | ( | ) |
Definition at line 625 of file create_engine.cpp.
References saved_game::classification(), DBG_MP, saved_game::expand_scenario(), game_config_manager::get(), game_config_manager::load_game_config_for_game(), preferences::login(), saved_game::mp_settings(), mp_game_settings::name, mp_game_settings::saved_game, state_, and vgettext().
Referenced by mp::create::process_event_impl().
void ng::create_engine::prepare_for_scenario | ( | ) |
Definition at line 531 of file create_engine.cpp.
References saved_game::classification(), current_level(), ng::level::data(), DBG_MP, game_classification::scenario_define, saved_game::set_carryover_sides_start(), and state_.
Referenced by mp::create::process_event_impl().
void ng::create_engine::reset_level_filters | ( | ) |
Definition at line 658 of file create_engine.cpp.
References campaigns_, campaigns_filtered_, i, level_name_filter_, random_maps_, random_maps_filtered_, scenarios_, scenarios_filtered_, sp_campaigns_, sp_campaigns_filtered_, user_maps_, user_maps_filtered_, user_scenarios_, and user_scenarios_filtered_.
Referenced by create_engine().
std::string ng::create_engine::select_campaign_difficulty | ( | int | set_value = -1 | ) |
select_campaign_difficulty
Launches difficulty selection gui and returns selected difficulty name.
The gui can be bypassed by supplying a number from 1 to the number of difficulties available, corresponding to a choice of difficulty. This is useful for specifying difficulty via command line.
set_value | Preselected difficulty number. The default -1 launches the gui. |
Definition at line 581 of file create_engine.cpp.
References current_level(), d, gui2::tcampaign_difficulty::selected_difficulty(), gui2::tdialog::show(), utils::split(), and video_.
Referenced by sp::enter_create_mode(), and mp::create::process_event_impl().
void ng::create_engine::set_current_era_index | ( | const size_t | index, |
bool | force = false |
||
) |
Definition at line 815 of file create_engine.cpp.
References current_era_index_, and dependency_manager_.
Referenced by gui2::tcampaign_settings::change_era(), and mp::create::process_event_impl().
void ng::create_engine::set_current_level | ( | const size_t | index | ) |
Definition at line 775 of file create_engine.cpp.
References campaigns_filtered_, ng::random_map::create_map_generator(), current_level(), current_level_index_, current_level_type(), current_level_type_, dependency_manager_, generator_, random_maps_filtered_, ng::depcheck::SCENARIO, scenarios_filtered_, sp_campaigns_filtered_, user_maps_filtered_, and user_scenarios_filtered_.
Referenced by sp::enter_create_mode(), and mp::create::init_level_changed().
void ng::create_engine::set_current_level_type | ( | const level::TYPE | type | ) |
Definition at line 765 of file create_engine.cpp.
References current_level_type_.
Referenced by sp::enter_create_mode(), mp::create::init_level_type_changed(), and mp::create::synchronize_selections().
void ng::create_engine::set_current_mod_index | ( | const size_t | index | ) |
Definition at line 822 of file create_engine.cpp.
References current_mod_index_.
Referenced by gui2::tcampaign_settings::change_mod(), gui2::tcampaign_selection::mod_toggled(), and mp::create::process_event_impl().
bool ng::create_engine::toggle_current_mod | ( | bool | force = false | ) |
Definition at line 837 of file create_engine.cpp.
References mp_game_settings::active_mods, current_level_type_, current_mod_index_, dependency_manager_, saved_game::mp_settings(), and state_.
Referenced by gui2::tcampaign_settings::change_mod(), gui2::tcampaign_selection::mod_toggled(), and mp::create::process_event_impl().
|
private |
Definition at line 287 of file create_engine.hpp.
Referenced by apply_level_filters(), current_level(), find_level_by_id(), find_level_type_by_id(), get_levels_by_type(), get_levels_by_type_unfiltered(), init_all_levels(), and reset_level_filters().
|
private |
Definition at line 294 of file create_engine.hpp.
Referenced by apply_level_filters(), get_levels_by_type(), reset_level_filters(), and set_current_level().
|
private |
Definition at line 278 of file create_engine.hpp.
Referenced by current_era_index(), current_extra(), get_parameters(), and set_current_era_index().
|
private |
Definition at line 276 of file create_engine.hpp.
Referenced by current_level(), and set_current_level().
|
private |
Definition at line 275 of file create_engine.hpp.
Referenced by create_engine(), current_level(), current_level_type(), levels_menu_item_names(), set_current_level(), set_current_level_type(), and toggle_current_mod().
|
private |
Definition at line 279 of file create_engine.hpp.
Referenced by current_extra(), current_mod_index(), set_current_mod_index(), and toggle_current_mod().
|
private |
Definition at line 308 of file create_engine.hpp.
Referenced by create_engine(), dependency_manager(), init_active_mods(), init_all_levels(), set_current_era_index(), set_current_level(), and toggle_current_mod().
|
private |
Definition at line 301 of file create_engine.hpp.
Referenced by get_const_extras_by_type(), get_extras_by_type(), and get_parameters().
|
private |
Definition at line 310 of file create_engine.hpp.
Referenced by generator_assigned(), generator_user_config(), init_generated_level_data(), and set_current_level().
|
private |
Definition at line 281 of file create_engine.hpp.
Referenced by apply_level_filter(), apply_level_filters(), level_name_filter(), and reset_level_filters().
|
private |
Definition at line 302 of file create_engine.hpp.
Referenced by get_const_extras_by_type(), and get_extras_by_type().
|
private |
Definition at line 282 of file create_engine.hpp.
Referenced by apply_level_filter(), apply_level_filters(), and player_num_filter().
|
private |
Definition at line 289 of file create_engine.hpp.
Referenced by apply_level_filters(), current_level(), find_level_by_id(), find_level_type_by_id(), get_levels_by_type(), get_levels_by_type_unfiltered(), init_all_levels(), and reset_level_filters().
|
private |
Definition at line 296 of file create_engine.hpp.
Referenced by apply_level_filters(), get_levels_by_type(), reset_level_filters(), and set_current_level().
|
private |
Definition at line 284 of file create_engine.hpp.
Referenced by apply_level_filters(), current_level(), find_level_by_id(), find_level_type_by_id(), get_levels_by_type(), get_levels_by_type_unfiltered(), init_all_levels(), and reset_level_filters().
|
private |
Definition at line 291 of file create_engine.hpp.
Referenced by apply_level_filters(), get_levels_by_type(), reset_level_filters(), and set_current_level().
|
private |
Definition at line 288 of file create_engine.hpp.
Referenced by apply_level_filters(), current_level(), find_level_by_id(), get_levels_by_type(), get_levels_by_type_unfiltered(), init_all_levels(), and reset_level_filters().
|
private |
Definition at line 295 of file create_engine.hpp.
Referenced by apply_level_filters(), get_levels_by_type(), reset_level_filters(), and set_current_level().
|
private |
Definition at line 304 of file create_engine.hpp.
Referenced by active_mods(), create_engine(), get_parameters(), get_state(), init_active_mods(), init_all_levels(), init_extras(), prepare_for_campaign(), prepare_for_era_and_mods(), prepare_for_new_level(), prepare_for_other(), prepare_for_saved_game(), prepare_for_scenario(), and toggle_current_mod().
|
private |
Definition at line 298 of file create_engine.hpp.
Referenced by create_engine(), and init_all_levels().
|
private |
Definition at line 285 of file create_engine.hpp.
Referenced by apply_level_filters(), current_level(), find_level_by_id(), find_level_type_by_id(), get_levels_by_type(), get_levels_by_type_unfiltered(), init_all_levels(), and reset_level_filters().
|
private |
Definition at line 292 of file create_engine.hpp.
Referenced by apply_level_filters(), get_levels_by_type(), reset_level_filters(), and set_current_level().
|
private |
Definition at line 299 of file create_engine.hpp.
Referenced by create_engine(), and init_all_levels().
|
private |
Definition at line 286 of file create_engine.hpp.
Referenced by apply_level_filters(), current_level(), find_level_by_id(), find_level_type_by_id(), get_levels_by_type(), get_levels_by_type_unfiltered(), init_all_levels(), and reset_level_filters().
|
private |
Definition at line 293 of file create_engine.hpp.
Referenced by apply_level_filters(), get_levels_by_type(), reset_level_filters(), and set_current_level().
|
private |
Definition at line 306 of file create_engine.hpp.
Referenced by create_engine(), and select_campaign_difficulty().