BiomeSphereManager
A class in Root.Township, the global namespace.
Holds a forest's biome spheres and answers which biome a point belongs to. Owned by the forest generation (ForestGeneration.BiomeSphereManager).
- Listed in Global namespace: A to B
Constructors
| Member | What it is |
|---|---|
BiomeSphereManager() | Creates a BiomeSphereManager with default values. |
Fields
3 private and internal fields
| Member | What it is |
|---|---|
private BiomeSphereGenerator generator | Serialized reference to a BiomeSphereGenerator. Not read in this class. |
private Dictionary<ForestBiome, List<BiomeSphere>> sorted | Spheres grouped by biome, for the filtered GetBiome. |
private List<BiomeSphere> spheres | Backing list for Spheres. |
Properties
| Member | What it is |
|---|---|
IEnumerable<BiomeSphere> Spheres { get; } | All registered spheres. |
Methods
| Member | What it is |
|---|---|
void DrawGizmos() | Draws each sphere as a wire sphere in its biome's colour. |
BiomeSphere GetBiome(SimplexNoise noise, Random random, Vector3 location, out float bestScore) | Returns the sphere scoring highest at a point, from distance to its centre and the biome's noise score. One overload limits it to some biomes. |
BiomeSphere GetBiome(SimplexNoise noise, Random random, Vector3 location, IEnumerable<ForestBiome> options, out float bestScore) | Returns the sphere scoring highest at a point, from distance to its centre and the biome's noise score. One overload limits it to some biomes. |
void Register(BiomeSphere sphere) | Adds a sphere to the list and to the per-biome lookup. |
void Serialize(Stream stream) | Writes or reads the sphere list to a stream. Reading registers each sphere. |
Used in
Members of other types that take, return or hold a BiomeSphereManager: