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

#include <cave_map_generator.hpp>

Inheritance diagram for cave_map_generator:
Inheritance graph

Classes

struct  cave_map_generator_job
 

Public Member Functions

 cave_map_generator (const config &game_config)
 
std::string name () const
 Returns a string identifying the generator by name. More...
 
std::string config_name () const
 Return a friendly name for the generator used to differentiate between different configs of the same generator. More...
 
std::string create_map (boost::optional< boost::uint32_t > randomseed=boost::none)
 Creates a new map and returns it. More...
 
config create_scenario (boost::optional< boost::uint32_t > randomseed=boost::none)
 
- Public Member Functions inherited from map_generator
virtual ~map_generator ()
 
virtual bool allow_user_config () const
 Returns true if the map generator has an interactive screen, which allows the user to modify how the generator behaves. More...
 
virtual void user_config (CVideo &v)
 Display the interactive screen, which allows the user to modify how the generator behaves. More...
 

Private Member Functions

bool on_board (const map_location &loc) const
 

Private Attributes

t_translation::t_terrain wall_
 
t_translation::t_terrain clear_
 
t_translation::t_terrain village_
 
t_translation::t_terrain castle_
 
t_translation::t_terrain keep_
 
config cfg_
 
int width_
 
int height_
 
int village_density_
 
int flipx_chance_
 
int flipy_chance_
 

Detailed Description

Definition at line 28 of file cave_map_generator.hpp.

Constructor & Destructor Documentation

cave_map_generator::cave_map_generator ( const config game_config)

Definition at line 33 of file cave_map_generator.cpp.

References cfg_, height_, village_density_, and width_.

Member Function Documentation

std::string cave_map_generator::config_name ( ) const
virtual

Return a friendly name for the generator used to differentiate between different configs of the same generator.

Implements map_generator.

Definition at line 52 of file cave_map_generator.cpp.

std::string cave_map_generator::create_map ( boost::optional< boost::uint32_t randomseed = boost::none)
virtual

Creates a new map and returns it.

args may contain arguments to the map generator.

Implements map_generator.

Definition at line 75 of file cave_map_generator.cpp.

References create_scenario().

config cave_map_generator::create_scenario ( boost::optional< boost::uint32_t randomseed = boost::none)
virtual

Reimplemented from map_generator.

Definition at line 81 of file cave_map_generator.cpp.

References cave_map_generator::cave_map_generator_job::res_.

Referenced by create_map().

std::string cave_map_generator::name ( ) const
inlinevirtual

Returns a string identifying the generator by name.

The name should not contain spaces.

Implements map_generator.

Definition at line 33 of file cave_map_generator.hpp.

bool cave_map_generator::on_board ( const map_location loc) const
inlineprivate

Definition at line 92 of file cave_map_generator.hpp.

References height_, width_, map_location::x, and map_location::y.

Member Data Documentation

t_translation::t_terrain cave_map_generator::castle_
private

Definition at line 97 of file cave_map_generator.hpp.

config cave_map_generator::cfg_
private

Definition at line 99 of file cave_map_generator.hpp.

Referenced by cave_map_generator().

t_translation::t_terrain cave_map_generator::clear_
private

Definition at line 97 of file cave_map_generator.hpp.

int cave_map_generator::flipx_chance_
private

Definition at line 104 of file cave_map_generator.hpp.

int cave_map_generator::flipy_chance_
private

Definition at line 104 of file cave_map_generator.hpp.

int cave_map_generator::height_
private

Definition at line 100 of file cave_map_generator.hpp.

Referenced by cave_map_generator(), and on_board().

t_translation::t_terrain cave_map_generator::keep_
private

Definition at line 97 of file cave_map_generator.hpp.

t_translation::t_terrain cave_map_generator::village_
private

Definition at line 97 of file cave_map_generator.hpp.

int cave_map_generator::village_density_
private

Definition at line 100 of file cave_map_generator.hpp.

Referenced by cave_map_generator().

t_translation::t_terrain cave_map_generator::wall_
private

Definition at line 97 of file cave_map_generator.hpp.

Referenced by passage_path_calculator::cost().

int cave_map_generator::width_
private

Definition at line 100 of file cave_map_generator.hpp.

Referenced by cave_map_generator(), and on_board().


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