The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
ng::create_engine Class Reference

#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< levellevel_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
 

Public Member Functions

 create_engine (CVideo &v, saved_game &state)
 
 ~create_engine ()
 
void init_generated_level_data ()
 
void prepare_for_new_level ()
 
void prepare_for_era_and_mods ()
 
void prepare_for_scenario ()
 
void prepare_for_campaign (const std::string &difficulty)
 
void prepare_for_saved_game ()
 
void prepare_for_other ()
 
std::string select_campaign_difficulty (int set_value=-1)
 select_campaign_difficulty More...
 
void apply_level_filter (const std::string &name)
 
void apply_level_filter (int players)
 
void reset_level_filters ()
 
const std::stringlevel_name_filter () const
 
int player_num_filter () const
 
std::vector< level_ptrget_levels_by_type_unfiltered (level::TYPE type) const
 
std::vector< level_ptrget_levels_by_type (level::TYPE type) const
 
std::vector< std::stringlevels_menu_item_names () const
 
std::vector< std::stringextras_menu_item_names (const MP_EXTRA extra_type, bool escape_markup=true) const
 
levelcurrent_level () const
 
const extras_metadatacurrent_extra (const MP_EXTRA extra_type) const
 
void set_current_level_type (const level::TYPE)
 
level::TYPE current_level_type () const
 
void set_current_level (const size_t index)
 
void set_current_era_index (const size_t index, bool force=false)
 
void set_current_mod_index (const size_t index)
 
size_t current_era_index () const
 
size_t current_mod_index () const
 
const std::vector
< extras_metadata_ptr > & 
get_const_extras_by_type (const MP_EXTRA extra_type) const
 
std::vector
< extras_metadata_ptr > & 
get_extras_by_type (const MP_EXTRA extra_type)
 
bool toggle_current_mod (bool force=false)
 
bool generator_assigned () const
 
void generator_user_config (CVideo &v)
 
int find_level_by_id (const std::string &id) const
 
int find_extra_by_id (const MP_EXTRA extra_type, const std::string &id) const
 
level::TYPE find_level_type_by_id (const std::string &id) const
 
const depcheck::manager & dependency_manager () const
 
void init_active_mods ()
 
std::vector< std::string > & active_mods ()
 
const mp_game_settingsget_parameters ()
 
saved_gameget_state ()
 

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
 

Private Attributes

level::TYPE current_level_type_
 
size_t current_level_index_
 
size_t current_era_index_
 
size_t current_mod_index_
 
std::string level_name_filter_
 
int player_count_filter_
 
std::vector< scenario_ptrscenarios_
 
std::vector< user_map_ptruser_maps_
 
std::vector< scenario_ptruser_scenarios_
 
std::vector< campaign_ptrcampaigns_
 
std::vector< campaign_ptrsp_campaigns_
 
std::vector< random_map_ptrrandom_maps_
 
std::vector< size_t > scenarios_filtered_
 
std::vector< size_t > user_maps_filtered_
 
std::vector< size_t > user_scenarios_filtered_
 
std::vector< size_t > campaigns_filtered_
 
std::vector< size_t > sp_campaigns_filtered_
 
std::vector< size_t > random_maps_filtered_
 
std::vector< std::stringuser_map_names_
 
std::vector< std::stringuser_scenario_names_
 
std::vector< extras_metadata_ptreras_
 
std::vector< extras_metadata_ptrmods_
 
saved_gamestate_
 
CVideovideo_
 
boost::scoped_ptr
< depcheck::manager > 
dependency_manager_
 
boost::scoped_ptr< map_generatorgenerator_
 

Detailed Description

Definition at line 179 of file create_engine.hpp.

Member Typedef Documentation

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.

Member Enumeration Documentation

Enumerator
ERA 
MOD 

Definition at line 185 of file create_engine.hpp.

Constructor & Destructor Documentation

ng::create_engine::create_engine ( CVideo v,
saved_game state 
)
ng::create_engine::~create_engine ( )

Definition at line 453 of file create_engine.cpp.

ng::create_engine::create_engine ( const create_engine )
private

Member Function Documentation

std::vector< std::string > & ng::create_engine::active_mods ( )
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().

void ng::create_engine::apply_level_filter ( int  players)

Definition at line 652 of file create_engine.cpp.

References apply_level_filters(), and player_count_filter_.

void ng::create_engine::apply_level_filters ( )
private
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
level & ng::create_engine::current_level ( ) const
level::TYPE ng::create_engine::current_level_type ( ) const
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
std::vector< std::string > ng::create_engine::extras_menu_item_names ( const MP_EXTRA  extra_type,
bool  escape_markup = true 
) const
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
level::TYPE ng::create_engine::find_level_type_by_id ( const std::string id) const
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().

void ng::create_engine::generator_user_config ( CVideo v)

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
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
std::vector< create_engine::level_ptr > ng::create_engine::get_levels_by_type_unfiltered ( level::TYPE  type) const
const mp_game_settings & ng::create_engine::get_parameters ( )
saved_game & ng::create_engine::get_state ( )
void ng::create_engine::init_active_mods ( )
void ng::create_engine::init_all_levels ( )
private
void ng::create_engine::init_extras ( const MP_EXTRA  extra_type)
private
void ng::create_engine::init_generated_level_data ( )
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
size_t ng::create_engine::map_level_index ( size_t  index) const
private
void ng::create_engine::operator= ( const create_engine )
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)
void ng::create_engine::prepare_for_era_and_mods ( )
void ng::create_engine::prepare_for_new_level ( )
void ng::create_engine::prepare_for_other ( )
void ng::create_engine::prepare_for_saved_game ( )
void ng::create_engine::prepare_for_scenario ( )
void ng::create_engine::reset_level_filters ( )
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.

Parameters
set_valuePreselected difficulty number. The default -1 launches the gui.
Returns
Selected difficulty. Returns "FAIL" if set_value is invalid, and "CANCEL" if the gui is canceled.

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 
)
void ng::create_engine::set_current_level ( const size_t  index)
void ng::create_engine::set_current_level_type ( const level::TYPE  type)
void ng::create_engine::set_current_mod_index ( const size_t  index)
bool ng::create_engine::toggle_current_mod ( bool  force = false)

Member Data Documentation

std::vector<campaign_ptr> ng::create_engine::campaigns_
private
std::vector<size_t> ng::create_engine::campaigns_filtered_
private
size_t ng::create_engine::current_era_index_
private
size_t ng::create_engine::current_level_index_
private

Definition at line 276 of file create_engine.hpp.

Referenced by current_level(), and set_current_level().

level::TYPE ng::create_engine::current_level_type_
private
size_t ng::create_engine::current_mod_index_
private
boost::scoped_ptr<depcheck::manager> ng::create_engine::dependency_manager_
private
std::vector<extras_metadata_ptr> ng::create_engine::eras_
private

Definition at line 301 of file create_engine.hpp.

Referenced by get_const_extras_by_type(), get_extras_by_type(), and get_parameters().

boost::scoped_ptr<map_generator> ng::create_engine::generator_
private
std::string ng::create_engine::level_name_filter_
private
std::vector<extras_metadata_ptr> ng::create_engine::mods_
private

Definition at line 302 of file create_engine.hpp.

Referenced by get_const_extras_by_type(), and get_extras_by_type().

int ng::create_engine::player_count_filter_
private

Definition at line 282 of file create_engine.hpp.

Referenced by apply_level_filter(), apply_level_filters(), and player_num_filter().

std::vector<random_map_ptr> ng::create_engine::random_maps_
private
std::vector<size_t> ng::create_engine::random_maps_filtered_
private
std::vector<scenario_ptr> ng::create_engine::scenarios_
private
std::vector<size_t> ng::create_engine::scenarios_filtered_
private
std::vector<campaign_ptr> ng::create_engine::sp_campaigns_
private
std::vector<size_t> ng::create_engine::sp_campaigns_filtered_
private
saved_game& ng::create_engine::state_
private
std::vector<std::string> ng::create_engine::user_map_names_
private

Definition at line 298 of file create_engine.hpp.

Referenced by create_engine(), and init_all_levels().

std::vector<user_map_ptr> ng::create_engine::user_maps_
private
std::vector<size_t> ng::create_engine::user_maps_filtered_
private
std::vector<std::string> ng::create_engine::user_scenario_names_
private

Definition at line 299 of file create_engine.hpp.

Referenced by create_engine(), and init_all_levels().

std::vector<scenario_ptr> ng::create_engine::user_scenarios_
private
std::vector<size_t> ng::create_engine::user_scenarios_filtered_
private
CVideo& ng::create_engine::video_
private

Definition at line 306 of file create_engine.hpp.

Referenced by create_engine(), and select_campaign_difficulty().


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