Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

LevelGenerator Class Reference

Here we have functions to generate levels. More...

#include <level_generator.h>

List of all members.

Static Public Methods

Map createEmptyMap (int width, int height, double fill)
Map createGoals (Map const &map, int goals)
Map createGems (Map const &map)
Movements createSolution (Map const &init_map, int pushes, int max_effort, Map &result_map)

Static Private Methods

void init ()
void removeGems (Map &map)

Static Private Attributes

bool s_was_initialized
std::vector< int > s_empty_pattern_lengths
std::vector< int > s_empty_pattern_offsets
std::vector< int > s_x_empty_patterns
std::vector< int > s_y_empty_patterns


Detailed Description

Here we have functions to generate levels.

Author:
Ralf Schmelter (ralfs@pc2a.chemie.uni-dortmund.de).
Version:
0.1


Member Function Documentation

Map LevelGenerator::createEmptyMap int width,
int height,
double fill
[static]
 

Creates a map without gems or goals.

Parameters:
width   The width of the map (must be 3 or greater and smaller than 128).
height   The height of the map (must be 3 or greater and smaller than 128).
fill   A parameter (in the range [0:1] which determines how much walls will be in the map. The higher the value, the more walls.

Map LevelGenerator::createGems Map const & map [static]
 

Fills the map with gems.

All original gems are deleted.

Parameters:
map   The map to use.

Map LevelGenerator::createGoals Map const & map,
int goals
[static]
 

Fills the map with random goals.

All original goals are deleted.

Parameters:
map   The map to use.
goals   The maximum number of goals.

Movements LevelGenerator::createSolution Map const & init_map,
int pushes,
int max_effort,
Map & result_map
[static]
 

Tries to create a map with the given number of pushes to find a solution.

Parameters:
init_map   The initial map.
pushes   The desired number of pushes.
max_effort   The maximum number of pushes to try until we consider to have failed.
result_map   The resulting start map will be stored here.
Returns:
The moves to solve the map or no moves at all if none could be made.

void LevelGenerator::init [static, private]
 

Initializes the class.

void LevelGenerator::removeGems Map & map [static, private]
 

Removes all gems from the given map.

Parameters:
map   The map to use.


Member Data Documentation

std::vector<int> LevelGenerator::s_empty_pattern_lengths [static, private]
 

The lengths of the empty patterns.

std::vector<int> LevelGenerator::s_empty_pattern_offsets [static, private]
 

The offsets of the empty patterns.

bool LevelGenerator::s_was_initialized [static, private]
 

If true, init has ben called.

std::vector<int> LevelGenerator::s_x_empty_patterns [static, private]
 

The x-coordinates of the empty patterns.

std::vector<int> LevelGenerator::s_y_empty_patterns [static, private]
 

The y-coordinates of the empty patterns.


The documentation for this class was generated from the following file:
Generated at Sun Jan 6 18:49:11 2002 for EasySok by doxygen1.2.9.1 written by Dimitri van Heesch, © 1997-2001