Loading...
Searching...
No Matches
CityBuilderCore.IPopulationManager Interface Reference

Detailed Description

manages the population and housing system

keeps track of different population migrations, housings and statistics

Inheritance diagram for CityBuilderCore.IPopulationManager:
CityBuilderCore.DefaultPopulationManager

Public Member Functions

int GetQuantity (Population population, bool includeReserved=false)
 calculates the total quantity of a population currently being housed in the city
 
int GetCapacity (Population population)
 calculates the total quantity of a population that can be housed in the city
 
int GetRemainingCapacity (Population population)
 calculated how many more of a population fits into the city
 
void AddHomeless (Population population, IHousing housing, int quantity)
 spawns homeless walkers that carry the population quantity and try to find new housing
used when housing downgrades and can no longer hold the quantity it did before
 
string SaveData ()
 
void LoadData (string json)
 

Member Function Documentation

◆ AddHomeless()

void CityBuilderCore.IPopulationManager.AddHomeless ( Population population,
IHousing housing,
int quantity )

spawns homeless walkers that carry the population quantity and try to find new housing
used when housing downgrades and can no longer hold the quantity it did before

Parameters
populationthe type of population(plebs, aristocrats, ...)
housingthe housing that downgraded
quantityquantity that no longer fits into the housing

Implemented in CityBuilderCore.DefaultPopulationManager.

◆ GetCapacity()

int CityBuilderCore.IPopulationManager.GetCapacity ( Population population)

calculates the total quantity of a population that can be housed in the city

Parameters
populationthe type of population(plebs, aristocrats, ...)
Returns
total capacit

Implemented in CityBuilderCore.DefaultPopulationManager.

◆ GetQuantity()

int CityBuilderCore.IPopulationManager.GetQuantity ( Population population,
bool includeReserved = false )

calculates the total quantity of a population currently being housed in the city

Parameters
populationthe type of population(plebs, aristocrats, ...)
includeReservedwhether migrants that have not arrived at their housing should be counted
Returns
total population count

Implemented in CityBuilderCore.DefaultPopulationManager.

◆ GetRemainingCapacity()

int CityBuilderCore.IPopulationManager.GetRemainingCapacity ( Population population)

calculated how many more of a population fits into the city

Parameters
populationthe type of population(plebs, aristocrats, ...)
Returns
remaining capacity in the city

Implemented in CityBuilderCore.DefaultPopulationManager.