Luanti 5.16.0-dev
Loading...
Searching...
No Matches
PseudoRandom Class Reference

#include <noise.h>

Public Member Functions

 PseudoRandom (s32 seed_=0)
void seed (s32 seed)
u32 next ()
s32 range (s32 min, s32 max)
s32 getState () const

Static Public Attributes

static const u32 RANDOM_RANGE = 32767

Private Attributes

s32 m_next

Constructor & Destructor Documentation

◆ PseudoRandom()

PseudoRandom::PseudoRandom ( s32 seed_ = 0)
inline

References seed().

Here is the call graph for this function:

Member Function Documentation

◆ getState()

s32 PseudoRandom::getState ( ) const
inline

References m_next.

Referenced by LuaPseudoRandom::l_get_state(), and TestRandom::testPseudoRandom().

Here is the caller graph for this function:

◆ next()

u32 PseudoRandom::next ( )
inline

References m_next, and RANDOM_RANGE.

Referenced by MapblockMeshGenerator::drawPlantlike(), MapblockMeshGenerator::drawPlantlikeQuad(), LuaPseudoRandom::l_next(), treegen::make_ltree(), rand_ortho_dir(), range(), TestRandom::testPseudoRandom(), and TestRandom::testPseudoRandomRange().

Here is the caller graph for this function:

◆ range()

s32 PseudoRandom::range ( s32 min,
s32 max )
inline

References next(), and RANDOM_RANGE.

Referenced by MapgenV6::generateCaves(), MapgenBasic::generateCavesRandomWalk(), MapgenBasic::generateDungeons(), LuaPseudoRandom::l_next(), treegen::make_jungletree(), treegen::make_ltree(), treegen::make_pine_tree(), treegen::make_tree(), MapgenV6::makeChunk(), MapgenV6::placeTreesAndJungleGrass(), random_turn(), TEST_CASE(), TestRandom::testPseudoRandomRange(), TestCompression::testZlibLargeData(), TestCompression::testZstdLargeData(), treegen::tree_leaves_placement(), and treegen::tree_single_leaves_placement().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ seed()

void PseudoRandom::seed ( s32 seed)
inline

References m_next, and seed().

Referenced by PseudoRandom(), and seed().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_next

s32 PseudoRandom::m_next
private

Referenced by getState(), next(), and seed().

◆ RANDOM_RANGE

const u32 PseudoRandom::RANDOM_RANGE = 32767
static

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