Skip to main content

PopulationItem

A class in Root.Township, Alta.Populations.

Marks an entity as spawned by a PopulationSample, with the spawn point it used. Server side.

Constructors​

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

Properties​

MemberWhat it is
NetworkEntity Entity { get; set; }The spawned entity.
PopulationSample Population { get; set; }The population sample that spawned it.
SpawnPoint SpawnPoint { get; set; }The spawn point the item was spawned at.

Methods​

MemberWhat it is
virtual void Initialize()Makes the entity work out its chunk from its own position.
void ReplaceWith(NetworkEntity entity)Asks the population to swap this item for another entity.
1 private and internal method
MemberWhat it is
private Chunk GetPositionChunk(NetworkEntity entity)Finds the location chunk that best contains the entity's current position. Installed on the entity by Initialize.

Used in​

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