Class BiomeRegistry
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
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
Selectable
Biomes climate-driven generation may choose (SelectionWeight > 0), in key order.
public static IReadOnlyList<BiomeTemplate> Selectable { get; }
Property Value
SupportedBiomes
Registered biome keys in ordinal order, so iteration is deterministic.
public static IReadOnlyList<string> SupportedBiomes { get; }
Property Value
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
biomeKeystring
Returns
Get(string)
The biome for a key, or null when none is registered.
public static BiomeTemplate Get(string biomeKey)
Parameters
biomeKeystring
Returns
GetDisplayName(string)
Display name for a biome key, or the key itself when the biome is unknown.
public static string GetDisplayName(string biomeKey)
Parameters
biomeKeystring
Returns
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
biomeBiomeTemplate
Returns
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
biomeBiomeTemplate
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
biomeKeystring
Returns
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
biomeKeystringbiomeBiomeTemplate
Returns
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
idintbiomeBiomeTemplate
Returns
Unregister(BiomeTemplate)
Removes a biome, but only if it is still the holder of its key.
public static void Unregister(BiomeTemplate biome)
Parameters
biomeBiomeTemplate
Events
Changed
Raised after a biome is registered or removed.
public static event Action Changed