Skip to content

API reference Obsidian.API.World.Generator.RandomSources

BitRandomSource class

Base for sources that produce values from a BitRandomSource.Next bit generator, with the same derivations as java.util.Random (vanilla BitRandomSource).

public abstract class BitRandomSource : IRandomSource

In Obsidian.API.

Constructors

protected BitRandomSource();

Methods

public void ConsumeCount(int count);public abstract IRandomSource Fork();public abstract IPositionalRandomFactory ForkPositional();

Next(int)

public abstract int Next(int bits);

Returns the next bits random bits (1 to 32) in the low bits of the result.

public bool NextBoolean();public double NextDouble();public float NextFloat();public double NextGaussian();public int NextInt();public int NextInt(int bound);public int NextInt(int origin, int bound);public int NextIntBetweenInclusive(int min, int max);public long NextLong();

ResetGaussian()

protected void ResetGaussian();

Discards a cached gaussian so the next BitRandomSource.NextGaussian starts a fresh pair.

public abstract void SetSeed(long seed);public double Triangle(double mode, double deviation);public float Triangle(float mode, float deviation);

On this page