The Battle for Wesnoth  1.15.1+dev
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< uint32_t > randomseed=boost::none)
 Creates a new map and returns it. More...
 
config create_scenario (boost::optional< 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 ()
 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::terrain_code wall_
 
t_translation::terrain_code clear_
 
t_translation::terrain_code village_
 
t_translation::terrain_code castle_
 
t_translation::terrain_code keep_
 
config cfg_
 
int width_
 
int height_
 
int village_density_
 
int flipx_chance_
 
int flipy_chance_
 

Detailed Description

Definition at line 27 of file cave_map_generator.hpp.

Constructor & Destructor Documentation

◆ cave_map_generator()

cave_map_generator::cave_map_generator ( const config game_config)

Definition at line 30 of file cave_map_generator.cpp.

References cfg_, height_, village_density_, and width_.

Member Function Documentation

◆ config_name()

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 49 of file cave_map_generator.cpp.

Referenced by name().

◆ create_map()

std::string cave_map_generator::create_map ( boost::optional< 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 72 of file cave_map_generator.cpp.

References create_scenario().

Referenced by name().

◆ create_scenario()

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

Reimplemented from map_generator.

Definition at line 78 of file cave_map_generator.cpp.

References cave_map_generator::cave_map_generator_job::res_.

Referenced by create_map(), and name().

◆ name()

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 32 of file cave_map_generator.hpp.

References config_name(), create_map(), and create_scenario().

◆ on_board()

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

Member Data Documentation

◆ castle_

t_translation::terrain_code cave_map_generator::castle_
private

◆ cfg_

config cave_map_generator::cfg_
private

◆ clear_

t_translation::terrain_code cave_map_generator::clear_
private

◆ flipx_chance_

int cave_map_generator::flipx_chance_
private

◆ flipy_chance_

int cave_map_generator::flipy_chance_
private

◆ height_

int cave_map_generator::height_
private

◆ keep_

t_translation::terrain_code cave_map_generator::keep_
private

◆ village_

t_translation::terrain_code cave_map_generator::village_
private

◆ village_density_

int cave_map_generator::village_density_
private

◆ wall_

t_translation::terrain_code cave_map_generator::wall_
private

◆ width_

int cave_map_generator::width_
private

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