The Battle for Wesnoth  1.19.5+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:

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 (utils::optional< uint32_t > randomseed={})
 Creates a new map and returns it. More...
 
config create_scenario (utils::optional< uint32_t > randomseed={})
 
- 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 26 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 34 of file cave_map_generator.cpp.

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.

◆ create_map()

std::string cave_map_generator::create_map ( utils::optional< uint32_t >  randomseed = {})
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().

◆ create_scenario()

config cave_map_generator::create_scenario ( utils::optional< uint32_t >  randomseed = {})
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().

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

◆ on_board()

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

Definition at line 90 of file cave_map_generator.hpp.

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

Member Data Documentation

◆ castle_

t_translation::terrain_code cave_map_generator::castle_
private

Definition at line 95 of file cave_map_generator.hpp.

◆ cfg_

config cave_map_generator::cfg_
private

Definition at line 97 of file cave_map_generator.hpp.

◆ clear_

t_translation::terrain_code cave_map_generator::clear_
private

Definition at line 95 of file cave_map_generator.hpp.

◆ 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

Definition at line 98 of file cave_map_generator.hpp.

Referenced by on_board().

◆ keep_

t_translation::terrain_code cave_map_generator::keep_
private

Definition at line 95 of file cave_map_generator.hpp.

◆ village_

t_translation::terrain_code cave_map_generator::village_
private

Definition at line 95 of file cave_map_generator.hpp.

◆ village_density_

int cave_map_generator::village_density_
private

Definition at line 98 of file cave_map_generator.hpp.

◆ wall_

t_translation::terrain_code cave_map_generator::wall_
private

Definition at line 95 of file cave_map_generator.hpp.

Referenced by passage_path_calculator::cost().

◆ width_

int cave_map_generator::width_
private

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