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

Detailed Description

a building component that houses populations(a hut that provides housing for 20 plebs, a villa that provides housing for 5 snobs)

Inheritance diagram for CityBuilderCore.IHousing:
CityBuilderCore.IBuildingTrait< IHousing > CityBuilderCore.HousingComponent CityBuilderCore.HousingPlaceholderComponent

Public Member Functions

int GetQuantity (Population population, bool includeReserved=false)
 checks how many people of a population are housed in the component
 
int GetCapacity (Population population)
 checks how many people of a population can be housed in the component
 
int GetRemainingCapacity (Population population)
 checks how many more people of the population would fit in the housing
 
int Reserve (Population population, int quantity)
 reserves space in the housing for inhabitants that are walking to it
this is done to make sure there is still place when they arrive
otherwise all immigrants in THREE would walk to the same housing until the first one arrives
 
int Inhabit (Population population, int quantity)
 removes reserved quantity and adds it to the housing
 
int Abandon (Population population, int quantity)
 removes a quantity of population from the housing
 
void Kill (float ratio)
 removes a portion of the housed quantities across populations
 

Additional Inherited Members

- Properties inherited from CityBuilderCore.IBuildingTrait< IHousing >
BuildingComponentReference< T > Reference [get, set]
 reference to the building trait, use when the building might be replaced and when the reference has to be saved
 

Member Function Documentation

◆ Abandon()

int CityBuilderCore.IHousing.Abandon ( Population population,
int quantity )

removes a quantity of population from the housing

Parameters
populationpopulation to remove
quantityquantity to remove
Returns
remaining quantity that was not there in the first place

Implemented in CityBuilderCore.HousingComponent, and CityBuilderCore.HousingPlaceholderComponent.

◆ GetCapacity()

int CityBuilderCore.IHousing.GetCapacity ( Population population)

checks how many people of a population can be housed in the component

Parameters
populationthe population to check
Returns
total quantity that will fit

Implemented in CityBuilderCore.HousingComponent, and CityBuilderCore.HousingPlaceholderComponent.

◆ GetQuantity()

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

checks how many people of a population are housed in the component

Parameters
populationthe population to check
includeReservedwhether inhabitants that have not arrived at the housing should be counted
Returns
population count in this housíng

Implemented in CityBuilderCore.HousingComponent, and CityBuilderCore.HousingPlaceholderComponent.

◆ GetRemainingCapacity()

int CityBuilderCore.IHousing.GetRemainingCapacity ( Population population)

checks how many more people of the population would fit in the housing

Parameters
populationthe relevant population
Returns
quantity that will still fit(capacity-quantity-reserved)

Implemented in CityBuilderCore.HousingComponent, and CityBuilderCore.HousingPlaceholderComponent.

◆ Inhabit()

int CityBuilderCore.IHousing.Inhabit ( Population population,
int quantity )

removes reserved quantity and adds it to the housing

Parameters
populationpopulation to add
quantityquantity to add
Returns
remaining quantity that would have exceeded capacity

Implemented in CityBuilderCore.HousingComponent, and CityBuilderCore.HousingPlaceholderComponent.

◆ Kill()

void CityBuilderCore.IHousing.Kill ( float ratio)

removes a portion of the housed quantities across populations

Parameters
ratio0-1

Implemented in CityBuilderCore.HousingComponent, and CityBuilderCore.HousingPlaceholderComponent.

◆ Reserve()

int CityBuilderCore.IHousing.Reserve ( Population population,
int quantity )

reserves space in the housing for inhabitants that are walking to it
this is done to make sure there is still place when they arrive
otherwise all immigrants in THREE would walk to the same housing until the first one arrives

Parameters
populationthe population to reserve
quantityhow many to reserve
Returns
remaining quantity that would have exceeded capacity

Implemented in CityBuilderCore.HousingComponent, and CityBuilderCore.HousingPlaceholderComponent.