Yasiu Math 1
Collection of mathematic functions that help create game mechanics and procedural tools
Loading...
Searching...
No Matches
USquirrel13 Class Reference

Random number generator. Seedable. More...

#include <SquirrelRNG.h>

Inheritance diagram for USquirrel13:

Public Member Functions

virtual void Serialize (FArchive &Ar) override
 Serialization of RNG Object.
void InitBP (int seed, int position=0)
 Modify internal values to custom.
int GetCurrentInt (int min, int max) const
 Return random value scaled to integer range <min, max> at current position.
int GetNextInt (int min, int max)
 Move position by 1 and return random value as integer in range <min, max>.
double GetCurrentDouble () const
 Return last random double in range <0, 1>.
double GetNextDouble ()
 Move position by 1 and return double in range <0, 1>.
int GetPosition () const
 Get generator position.
void SetPosition (int new_position)
 Set generator position.
void OffsetPosition (int offset=1)
 Offset current position, can be positive and negative.
int32 GetSeed () const
 Get generator position.
void SetSeed (int new_seed)
 Set seed noise seed.
void SetNoiseVariant (int newVariant=0)
 Internal noise variants (it is not initialized, but saved), default=0, max=5 Invalid variants will use default noise.
void ResetSeedPos ()
 Reset to internal initial values, InitBP must be used before!

Static Protected Member Functions

static uint32 RNG_0 (int position, unsigned int seed)
 Noise variant.
static uint32 RNG_1 (int position, unsigned int seed)
 Noise variant.
static uint32 RNG_2 (int position, unsigned int seed)
 Noise variant.
static uint32 RNG_3 (int position, unsigned int seed)
 Noise variant.
static uint32 RNG_4 (int position, unsigned int seed)
 Noise variant.
static uint32 RNG_5 (int position, unsigned int seed)
 Noise variant.

Protected Attributes

int m_variant {0}
 variable related to selected noise variant

Detailed Description

Random number generator. Seedable.

Gives better random values than epic generator.

  • NetReplicated: Yes
  • GameSave: Yes

Member Function Documentation

◆ InitBP()

void USquirrel13::InitBP ( int seed,
int position = 0 )

Modify internal values to custom.

This function provides access to change private variables for C++ object which is not accessible in Blueprints.

◆ OffsetPosition()

void USquirrel13::OffsetPosition ( int offset = 1)

Offset current position, can be positive and negative.

Position + Offset


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