Table of Contents

Class SeedBox

Namespace
Shard.WorldGen.Rng
Assembly
Shard.WorldGen.dll

Port of the v2 generator's SeedBox (builtin/HytaleGenerator rng/SeedBox). A seed is a string key; Child(string) derives sub-seeds by concatenation (so a node's "Seed" string appends to the parent key), and CreateSupplier() turns the key into a deterministic int stream via new JavaRandom(key.hashCode()). The concrete int seed a noise node gets is parentSeed.Child(seedKey).CreateSupplier()().

public sealed class SeedBox
Inheritance
SeedBox
Inherited Members

Constructors

SeedBox(int)

public SeedBox(int key)

Parameters

key int

SeedBox(string)

public SeedBox(string key)

Parameters

key string

Methods

Child(string)

A child seed whose key is this.key + childKey (matches Java's string concat).

public SeedBox Child(string childKey)

Parameters

childKey string

Returns

SeedBox

CreateSupplier()

A deterministic int stream seeded by the Java hash of the key. Each call advances the stream — exactly like Java's createSupplier().get() returning rand.nextInt().

public Func<int> CreateSupplier()

Returns

Func<int>

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.