cave_map_generator Class Reference

#include <cavegen.hpp>

Inheritance diagram for cave_map_generator:

Inheritance graph
[legend]
Collaboration diagram for cave_map_generator:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 cave_map_generator (const config *game_config)
bool allow_user_config () const
 Returns true iff the map generator has an interactive screen, which allows the user to modify how the generator behaves.
void user_config (display &)
 Display the interactive screen, which allows the user to modify how the generator behaves.
std::string name () const
 Returns a string identifying the generator by name.
std::string create_map (const std::vector< std::string > &args)
 Creates a new map and returns it.
config create_scenario (const std::vector< std::string > &args)

Private Member Functions

void generate_chambers ()
void build_chamber (gamemap::location loc, std::set< gamemap::location > &locs, size_t size, size_t jagged)
void place_chamber (const chamber &c)
void place_items (const chamber &c, config::all_children_iterator i1, config::all_children_iterator i2)
void place_passage (const passage &p)
bool on_board (const gamemap::location &loc) const
void set_terrain (gamemap::location loc, t_translation::t_terrain t)
void place_castle (const std::string &side, gamemap::location loc)
size_t translate_x (size_t x) const
size_t translate_y (size_t y) 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_
t_translation::t_map map_
std::map< int,
t_translation::coordinate
starting_positions_
std::map< std::string, size_t > chamber_ids_
std::vector< chamberchambers_
std::vector< passagepassages_
config res_
const configcfg_
size_t width_
size_t height_
size_t village_density_
bool flipx_
bool flipy_

Classes

struct  chamber
struct  passage


Detailed Description

Definition at line 26 of file cavegen.hpp.


Constructor & Destructor Documentation

cave_map_generator::cave_map_generator ( const config game_config  ) 

Definition at line 30 of file cavegen.cpp.

References cfg_, gamemap::default_border, flipx_, flipy_, height_, LOG_NG, r, village_density_, and width_.


Member Function Documentation

bool cave_map_generator::allow_user_config (  )  const [inline, virtual]

Returns true iff the map generator has an interactive screen, which allows the user to modify how the generator behaves.

Implements map_generator.

Definition at line 31 of file cavegen.hpp.

void cave_map_generator::user_config ( display disp  )  [inline, virtual]

Display the interactive screen, which allows the user to modify how the generator behaves.

(This function will not be called if allow_user_config() returns false).

Implements map_generator.

Definition at line 33 of file cavegen.hpp.

std::string cave_map_generator::name (  )  const [inline, virtual]

Returns a string identifying the generator by name.

The name should not contain spaces.

Implements map_generator.

Definition at line 35 of file cavegen.hpp.

std::string cave_map_generator::create_map ( const std::vector< std::string > &  args  )  [virtual]

Creates a new map and returns it.

args may contain arguments to the map generator.

Implements map_generator.

Definition at line 76 of file cavegen.cpp.

References create_scenario().

config cave_map_generator::create_scenario ( const std::vector< std::string > &  args  )  [virtual]

void cave_map_generator::generate_chambers (  )  [private]

void cave_map_generator::build_chamber ( gamemap::location  loc,
std::set< gamemap::location > &  locs,
size_t  size,
size_t  jagged 
) [private]

Definition at line 118 of file cavegen.cpp.

References get_adjacent_tiles(), and on_board().

Referenced by generate_chambers(), and place_passage().

void cave_map_generator::place_chamber ( const chamber c  )  [private]

void cave_map_generator::place_items ( const chamber c,
config::all_children_iterator  i1,
config::all_children_iterator  i2 
) [private]

void cave_map_generator::place_passage ( const passage p  )  [private]

bool cave_map_generator::on_board ( const gamemap::location loc  )  const [inline, private]

Definition at line 65 of file cavegen.hpp.

References height_, width_, gamemap::location::x, and gamemap::location::y.

Referenced by build_chamber(), and set_terrain().

void cave_map_generator::set_terrain ( gamemap::location  loc,
t_translation::t_terrain  t 
) [private]

void cave_map_generator::place_castle ( const std::string &  side,
gamemap::location  loc 
) [private]

size_t cave_map_generator::translate_x ( size_t  x  )  const [private]

Definition at line 58 of file cavegen.cpp.

References flipx_, and width_.

Referenced by generate_chambers().

size_t cave_map_generator::translate_y ( size_t  y  )  const [private]

Definition at line 67 of file cavegen.cpp.

References flipy_, and height_.

Referenced by generate_chambers().


Member Data Documentation

Definition at line 75 of file cavegen.hpp.

Referenced by create_scenario(), place_passage(), and set_terrain().

Definition at line 75 of file cavegen.hpp.

Referenced by place_chamber(), place_passage(), and set_terrain().

Definition at line 75 of file cavegen.hpp.

Referenced by set_terrain().

Definition at line 75 of file cavegen.hpp.

Referenced by place_castle().

Definition at line 75 of file cavegen.hpp.

Referenced by place_castle().

Definition at line 76 of file cavegen.hpp.

Referenced by create_scenario(), place_passage(), and set_terrain().

Definition at line 77 of file cavegen.hpp.

Referenced by create_scenario(), and place_castle().

std::map<std::string,size_t> cave_map_generator::chamber_ids_ [private]

Definition at line 79 of file cavegen.hpp.

Referenced by generate_chambers().

std::vector<chamber> cave_map_generator::chambers_ [private]

Definition at line 80 of file cavegen.hpp.

Referenced by create_scenario(), and generate_chambers().

std::vector<passage> cave_map_generator::passages_ [private]

Definition at line 81 of file cavegen.hpp.

Referenced by create_scenario(), and generate_chambers().

Definition at line 83 of file cavegen.hpp.

Referenced by create_scenario(), and place_items().

const config* cave_map_generator::cfg_ [private]

Definition at line 84 of file cavegen.hpp.

Referenced by cave_map_generator(), create_scenario(), and generate_chambers().

size_t cave_map_generator::width_ [private]

size_t cave_map_generator::height_ [private]

Definition at line 85 of file cavegen.hpp.

Referenced by cave_map_generator(), and set_terrain().

Definition at line 89 of file cavegen.hpp.

Referenced by cave_map_generator(), and translate_x().

Definition at line 89 of file cavegen.hpp.

Referenced by cave_map_generator(), and translate_y().


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

Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs