Table of Contents

Class BiomeRegistry

Namespace
FishMMO.Shared.Biomes
Assembly
FishMMO.Shared.dll

Runtime index of every loaded BiomeTemplate, by key and by cached-object ID. Holds no data of its own: templates register as Addressables load them (or as the editor loader finds them) and leave when they unload.

public static class BiomeRegistry
Inheritance
BiomeRegistry
Inherited Members

Properties

Count

Number of biomes currently registered.

public static int Count { get; }

Property Value

int

NameableBiomes

Keys of the registered biomes that carry usable naming data, in key order — what the name generator can name from. A biome without naming (a designer's new terrain-only biome) is still registered for terrain and maps, but is not offered here.

public static IReadOnlyList<string> NameableBiomes { get; }

Property Value

IReadOnlyList<string>

Selectable

Biomes climate-driven generation may choose (SelectionWeight > 0), in key order.

public static IReadOnlyList<BiomeTemplate> Selectable { get; }

Property Value

IReadOnlyList<BiomeTemplate>

SupportedBiomes

Registered biome keys in ordinal order, so iteration is deterministic.

public static IReadOnlyList<string> SupportedBiomes { get; }

Property Value

IReadOnlyList<string>

Methods

Clear()

Removes every biome. Tests and the editor loader use this before a fresh registration.

public static void Clear()

Contains(string)

public static bool Contains(string biomeKey)

Parameters

biomeKey string

Returns

bool

Get(string)

The biome for a key, or null when none is registered.

public static BiomeTemplate Get(string biomeKey)

Parameters

biomeKey string

Returns

BiomeTemplate

GetDisplayName(string)

Display name for a biome key, or the key itself when the biome is unknown.

public static string GetDisplayName(string biomeKey)

Parameters

biomeKey string

Returns

string

IDOf(BiomeTemplate)

The biome's cached-object ID, derived from type and name when the cache has not assigned one (edit mode).

public static int IDOf(BiomeTemplate biome)

Parameters

biome BiomeTemplate

Returns

int

Register(BiomeTemplate)

Registers a biome under its key and ID. A second biome resolving to the same key replaces the first with a warning, since names would otherwise silently come from whichever loaded last.

public static void Register(BiomeTemplate biome)

Parameters

biome BiomeTemplate

ResolvePhonology(string)

The runtime naming phonology for a biome, or null when the biome is unknown or has none.

public static BiomePhonology ResolvePhonology(string biomeKey)

Parameters

biomeKey string

Returns

BiomePhonology

TryGet(string, out BiomeTemplate)

Looks a biome up by key; the key is normalised first, so "Alpine Meadow" finds "alpinemeadow".

public static bool TryGet(string biomeKey, out BiomeTemplate biome)

Parameters

biomeKey string
biome BiomeTemplate

Returns

bool

TryGetByID(int, out BiomeTemplate)

Looks a biome up by cached-object ID — what biome maps, race affinities and [TemplateReference] fields store.

public static bool TryGetByID(int id, out BiomeTemplate biome)

Parameters

id int
biome BiomeTemplate

Returns

bool

Unregister(BiomeTemplate)

Removes a biome, but only if it is still the holder of its key.

public static void Unregister(BiomeTemplate biome)

Parameters

biome BiomeTemplate

Events

Changed

Raised after a biome is registered or removed.

public static event Action Changed

Event Type

Action