Cuberite
A lightweight, fast and extensible game server for Minecraft
Public Types | Public Member Functions | Protected Attributes | Private Types | List of all members
cIntGenReplaceRandomly< SizeX, SizeZ > Class Template Reference

Randomly replaces pixels of one value to another value, using the given chance. More...

#include <IntGen.h>

Inheritance diagram for cIntGenReplaceRandomly< SizeX, SizeZ >:
Inheritance graph
[legend]
Collaboration diagram for cIntGenReplaceRandomly< SizeX, SizeZ >:
Collaboration graph
[legend]

Public Types

using Underlying = std::shared_ptr< cIntGen< SizeX, SizeZ > >
 
- Public Types inherited from cIntGen< SizeX, SizeZ >
using IntGenType = cIntGen< SizeX, SizeZ >
 
using Values = int[SizeX *SizeZ]
 Holds the array of values generated by this class (descendant). More...
 

Public Member Functions

 cIntGenReplaceRandomly (int a_From, int a_To, int a_Chance, int a_Seed, Underlying a_Underlying)
 
virtual void GetInts (int a_MinX, int a_MinZ, typename Super::Values &a_Values) override
 Generates the array of templated size into a_Values, based on given min coords. More...
 
- Public Member Functions inherited from cIntGenWithNoise< SizeX, SizeX >
 cIntGenWithNoise (int a_Seed)
 
- Public Member Functions inherited from cIntGen< SizeX, SizeZ >
virtual ~cIntGen ()
 Force a virtual destructor in all descendants. More...
 

Protected Attributes

int m_Chance
 Chance, in permille, of replacing the value. More...
 
int m_From
 The original value to be replaced. More...
 
int m_To
 The destination value to which to replace. More...
 
Underlying m_Underlying
 
- Protected Attributes inherited from cIntGenWithNoise< SizeX, SizeX >
cNoise m_Noise
 

Private Types

using Super = cIntGenWithNoise< SizeX, SizeZ >
 

Additional Inherited Members

- Protected Member Functions inherited from cIntGenWithNoise< SizeX, SizeX >
int ChooseRandomOne (int a_RndX, int a_RndZ, int a_Val1, int a_Val2)
 Chooses one of a_Val1 or a_Val2, based on m_Noise and the coordinates for querying the noise. More...
 
int ChooseRandomOne (int a_RndX, int a_RndZ, int a_Val1, int a_Val2, int a_Val3, int a_Val4)
 Chooses one of a_ValN, based on m_Noise and the coordinates for querying the noise. More...
 

Detailed Description

template<int SizeX, int SizeZ = SizeX>
class cIntGenReplaceRandomly< SizeX, SizeZ >

Randomly replaces pixels of one value to another value, using the given chance.

Definition at line 795 of file IntGen.h.

Member Typedef Documentation

◆ Super

template<int SizeX, int SizeZ = SizeX>
using cIntGenReplaceRandomly< SizeX, SizeZ >::Super = cIntGenWithNoise<SizeX, SizeZ>
private

Definition at line 798 of file IntGen.h.

◆ Underlying

template<int SizeX, int SizeZ = SizeX>
using cIntGenReplaceRandomly< SizeX, SizeZ >::Underlying = std::shared_ptr<cIntGen<SizeX, SizeZ> >

Definition at line 802 of file IntGen.h.

Constructor & Destructor Documentation

◆ cIntGenReplaceRandomly()

template<int SizeX, int SizeZ = SizeX>
cIntGenReplaceRandomly< SizeX, SizeZ >::cIntGenReplaceRandomly ( int  a_From,
int  a_To,
int  a_Chance,
int  a_Seed,
Underlying  a_Underlying 
)
inline

Definition at line 805 of file IntGen.h.

Member Function Documentation

◆ GetInts()

template<int SizeX, int SizeZ = SizeX>
virtual void cIntGenReplaceRandomly< SizeX, SizeZ >::GetInts ( int  a_MinX,
int  a_MinZ,
typename Super::Values a_Values 
)
inlineoverridevirtual

Generates the array of templated size into a_Values, based on given min coords.

Implements cIntGen< SizeX, SizeZ >.

Definition at line 815 of file IntGen.h.

Member Data Documentation

◆ m_Chance

template<int SizeX, int SizeZ = SizeX>
int cIntGenReplaceRandomly< SizeX, SizeZ >::m_Chance
protected

Chance, in permille, of replacing the value.

Definition at line 848 of file IntGen.h.

◆ m_From

template<int SizeX, int SizeZ = SizeX>
int cIntGenReplaceRandomly< SizeX, SizeZ >::m_From
protected

The original value to be replaced.

Definition at line 842 of file IntGen.h.

◆ m_To

template<int SizeX, int SizeZ = SizeX>
int cIntGenReplaceRandomly< SizeX, SizeZ >::m_To
protected

The destination value to which to replace.

Definition at line 845 of file IntGen.h.

◆ m_Underlying

template<int SizeX, int SizeZ = SizeX>
Underlying cIntGenReplaceRandomly< SizeX, SizeZ >::m_Underlying
protected

Definition at line 850 of file IntGen.h.


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