Cuberite
A lightweight, fast and extensible game server for Minecraft
Public Types | Public Member Functions | Protected Attributes | Private Types | List of all members
cProtIntGenReplaceRandomly Class Reference

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

#include <ProtIntGen.h>

Inheritance diagram for cProtIntGenReplaceRandomly:
Inheritance graph
[legend]
Collaboration diagram for cProtIntGenReplaceRandomly:
Collaboration graph
[legend]

Public Types

using Underlying = std::shared_ptr< cProtIntGen >
 
- Public Types inherited from cProtIntGen
using Underlying = std::shared_ptr< cProtIntGen >
 Type of the generic interface used for storing links to the underlying generators. More...
 

Public Member Functions

 cProtIntGenReplaceRandomly (int a_Seed, int a_From, int a_To, int a_Chance, Underlying a_Underlying)
 
virtual void GetInts (int a_MinX, int a_MinZ, size_t a_SizeX, size_t a_SizeZ, int *a_Values) override
 Generates the array of specified size into a_Values, based on given min coords. More...
 
- Public Member Functions inherited from cProtIntGenWithNoise
 cProtIntGenWithNoise (int a_Seed)
 
- Public Member Functions inherited from cProtIntGen
virtual ~cProtIntGen ()
 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 cProtIntGenWithNoise
cNoise m_Noise
 

Private Types

using Super = cProtIntGenWithNoise
 

Additional Inherited Members

- Protected Member Functions inherited from cProtIntGenWithNoise
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...
 
- Static Protected Attributes inherited from cProtIntGen
static const int m_BufferSize = PROT_INT_BUFFER_SIZE
 Maximum size of the generated area. More...
 

Detailed Description

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

Definition at line 1060 of file ProtIntGen.h.

Member Typedef Documentation

◆ Super

Definition at line 1063 of file ProtIntGen.h.

◆ Underlying

Definition at line 1067 of file ProtIntGen.h.

Constructor & Destructor Documentation

◆ cProtIntGenReplaceRandomly()

cProtIntGenReplaceRandomly::cProtIntGenReplaceRandomly ( int  a_Seed,
int  a_From,
int  a_To,
int  a_Chance,
Underlying  a_Underlying 
)
inline

Definition at line 1070 of file ProtIntGen.h.

Member Function Documentation

◆ GetInts()

virtual void cProtIntGenReplaceRandomly::GetInts ( int  a_MinX,
int  a_MinZ,
size_t  a_SizeX,
size_t  a_SizeZ,
int *  a_Values 
)
inlineoverridevirtual

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

Implements cProtIntGen.

Definition at line 1080 of file ProtIntGen.h.

Member Data Documentation

◆ m_Chance

int cProtIntGenReplaceRandomly::m_Chance
protected

Chance, in permille, of replacing the value.

Definition at line 1113 of file ProtIntGen.h.

◆ m_From

int cProtIntGenReplaceRandomly::m_From
protected

The original value to be replaced.

Definition at line 1107 of file ProtIntGen.h.

◆ m_To

int cProtIntGenReplaceRandomly::m_To
protected

The destination value to which to replace.

Definition at line 1110 of file ProtIntGen.h.

◆ m_Underlying

Underlying cProtIntGenReplaceRandomly::m_Underlying
protected

Definition at line 1115 of file ProtIntGen.h.


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