Advanced Strategic Command
Public Member Functions | Static Public Attributes | List of all members
ResourcePlacement Class Reference

Fills a map with resources using the diamond-square algorithm. More...

#include <resourceplacement.h>

Public Member Functions

 ResourcePlacement (GameMap &map, double fuelRoughness, double materialRoughness, unsigned short maxFuelOffSet, unsigned short maxMaterialOffSet, int additionalFreeFieldsPercFuel=0, int additionalFreeFieldsPercMaterial=0)
 Constructor. More...
 
 ~ResourcePlacement ()
 Destructor. More...
 
void placeResources ()
 Fills the map with all resources. More...
 
void placeFuelResources ()
 Fills the map only with fuel resources. More...
 
void placeMaterialResources ()
 Fills the map only with material resources. More...
 

Static Public Attributes

static const int MAXFUELVALUE = 255
 
static const int MINFUELVALUE = 0
 
static const int MAXMATERIALVALUE = 255
 
static const int MINMATERIALVALUE = 0
 

Detailed Description

Fills a map with resources using the diamond-square algorithm.

Author
Kevin Hirschmann

Definition at line 33 of file resourceplacement.h.

Constructor & Destructor Documentation

ResourcePlacement::ResourcePlacement ( GameMap map,
double  fuelRoughness,
double  materialRoughness,
unsigned short  maxFuelOffSet,
unsigned short  maxMaterialOffSet,
int  additionalFreeFieldsPercFuel = 0,
int  additionalFreeFieldsPercMaterial = 0 
)

Constructor.

Configures algorithm with algorithm determining parameters

Parameters
mapThe map which is filled with resources
fuelRoughnessDecides how large the offset (relative) for fuel between the fields may be. Value must be 0 < value < 4.0 The higher the value the more "hills" and "valleys" you get
materialRoughnessDecides how large the offset (relative) for material between neighbouring fields may be. Value must be 0 < value < 4.0 The higher the value the more "hills" and "valleys" you get
maxFuelOffSetDetermines the absolut offset fuelFields might have
maxMaterialOffSetDetermines the absolut offset materialFields might have

Definition at line 23 of file resourceplacement.cpp.

ResourcePlacement::~ResourcePlacement ( )

Destructor.

Definition at line 41 of file resourceplacement.cpp.

Member Function Documentation

void ResourcePlacement::placeFuelResources ( )

Fills the map only with fuel resources.

Definition at line 49 of file resourceplacement.cpp.

Referenced by ResourcePlacementDialog::buttonEvent().

void ResourcePlacement::placeMaterialResources ( )

Fills the map only with material resources.

Definition at line 55 of file resourceplacement.cpp.

Referenced by ResourcePlacementDialog::buttonEvent().

void ResourcePlacement::placeResources ( )

Fills the map with all resources.

Definition at line 43 of file resourceplacement.cpp.

Referenced by ResourcePlacementDialog::buttonEvent().

Member Data Documentation

const int ResourcePlacement::MAXFUELVALUE = 255
static
const int ResourcePlacement::MAXMATERIALVALUE = 255
static
const int ResourcePlacement::MINFUELVALUE = 0
static
const int ResourcePlacement::MINMATERIALVALUE = 0
static

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