mercator 0.4.0
A terrain generation library for the Worldforge system.
RandCache Class Reference

A cache of random values. More...

#include <RandCache.h>

Classes

struct  Ordering
 Interface to define the ordering of the random number cache. More...
 

Public Types

typedef WFMath::MTRand::uint32 uint32
 Unsigned 32bit integer. More...
 
typedef std::vector< uint32 >::size_type size_type
 Size type of std::vector. More...
 

Public Member Functions

 RandCache (uint32 seed, std::unique_ptr< Ordering > o)
 Constructor. More...
 
 RandCache (uint32 *seed, uint32 seed_len, std::unique_ptr< Ordering > o)
 Constructor. More...
 
double operator() (int x, int y)
 Retrieve a random value associated with parameters. More...
 

Detailed Description

A cache of random values.

Definition at line 19 of file RandCache.h.

Member Typedef Documentation

◆ size_type

typedef std::vector<uint32>::size_type RandCache::size_type

Size type of std::vector.

Definition at line 25 of file RandCache.h.

◆ uint32

typedef WFMath::MTRand::uint32 RandCache::uint32

Unsigned 32bit integer.

Definition at line 23 of file RandCache.h.

Constructor & Destructor Documentation

◆ RandCache() [1/2]

RandCache::RandCache ( uint32  seed,
std::unique_ptr< Ordering o 
)
inline

Constructor.

Parameters
seedthe random seed value for generated numbers.
othe ordering object that defines the sequence generated.

Definition at line 38 of file RandCache.h.

◆ RandCache() [2/2]

RandCache::RandCache ( uint32 seed,
uint32  seed_len,
std::unique_ptr< Ordering o 
)
inline

Constructor.

Parameters
seedthe random seed block for generated numbers.
seed_lenthe length of the seed block.
othe ordering object that defines the sequence generated.

Definition at line 45 of file RandCache.h.

Member Function Documentation

◆ operator()()

double RandCache::operator() ( int  x,
int  y 
)
inline

Retrieve a random value associated with parameters.

Parameters
xcoordinate associated with value to be retrieved.
ycoordinate associated with value to be retrieved.

Definition at line 53 of file RandCache.h.


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