Skip to main content

SimplePopulationValue

A class in Root.Township, Alta.Populations.

Spawn information that asks an ISpawnPositions source for points by index and caches them.

Constructors​

MemberWhat it is
SimplePopulationValue(ISpawnPositions positions, SpawnData spawnData)Creates a SimplePopulationValue from positions and spawnData.

Fields​

2 private and internal fields
MemberWhat it is
private static Logger loggerNLog logger for this class. Unused.
private Dictionary<int, SpawnPoint> trackedCache of points already made, by index. Never cleared.

Properties​

MemberWhat it is
ISpawnPositions Positions { get; }The source of spawn positions.

Methods​

MemberWhat it is
override SpawnPoint GetPoint(int pointIndex)Returns the cached point for an index, or gets it from Positions and caches it.
override SpawnPoint GetRandom(PopulationDefinition definition)Tries up to three random indexes and returns the first free point the definition accepts, or null. Each try adds to the cache.