Skip to main content

BasicEcosystem

A class in Root.Township, Alta.Populations.

Server: per chunk lookup of the BasicPopulations registered in a location chunk, keyed by their PopulationSetup. Reached through the chunk's Environment.Ecosystem.

Constructors​

MemberWhat it is
BasicEcosystem()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

2 private and internal fields
MemberWhat it is
private static Logger loggerPrivate: logs double registrations.
private Dictionary<PopulationSetup, BasicPopulation> populationsPrivate: registered populations by PopulationSetup.

Methods​

MemberWhat it is
void Add(BasicPopulation population)Registers a population under its definition. A second one with the same definition is refused with an error.
BasicPopulation Get(PopulationSetup setup)Returns the population for a setup in this chunk, or null.
void Remove(BasicPopulation population)Removes the population registered under its definition.

Used in​

Members of other types that take, return or hold a BasicEcosystem: