ClassicCityBuilderKit 1.8.8
|
manages the employment system
distributes the different populations to their appropriate workplaces
when employees are missing, employees are assigned by employment group priority
this priority can be changed at runtime
Public Member Functions | |
void | AddEmployment (IEmployment employment) |
registers an employment with the manager so that it can now be considered when distributing available employees typically called in Start | |
void | RemoveEmployment (IEmployment employment) |
removes an employment that was previously added to the manager, the employment will no longer have any employees assigned typically called in OnDestroy | |
void | CheckEmployment () |
forces immediate redistribution of employees ususally the manager does this itself, this is called after loading so there is no wait time | |
int | GetAvailable (Population population, EmploymentGroup group=null) |
checks how many employees in a population are available for work | |
int | GetEmployed (Population population, EmploymentGroup group=null) |
checks how many employees in a population are currently employed | |
int | GetNeeded (Population population, EmploymentGroup group=null) |
checks how many employees in a population are currently needed | |
float | GetEmploymentRate (Population population) |
calculates employment rate for a population(needed/available) 100 jobs for 200 employees > 0.5 300 jobs for 100 employees > 3.0 | |
float | GetWorkerRate (Population population) |
calculates worker rate for population(available/needed) 100 jobs for 200 employees > 2.0 300 jobs for 150 employees > 0.5 | |
int | GetPriority (EmploymentGroup group) |
checks the current priority of an employment group the priority determines in which order employees are assigned | |
void | SetPriority (EmploymentGroup group, int priority) |
changes the priority of an employment group this changes which employment groups employees are distributed to first | |
string | SaveData () |
void | LoadData (string json) |
void CityBuilderCore.IEmploymentManager.AddEmployment | ( | IEmployment | employment | ) |
registers an employment with the manager so that it can now be considered when distributing available employees
typically called in Start
employment | the employment to add to the manager |
Implemented in CityBuilderCore.DefaultPopulationManager.
void CityBuilderCore.IEmploymentManager.CheckEmployment | ( | ) |
forces immediate redistribution of employees
ususally the manager does this itself, this is called after loading so there is no wait time
Implemented in CityBuilderCore.DefaultPopulationManager.
int CityBuilderCore.IEmploymentManager.GetAvailable | ( | Population | population, |
EmploymentGroup | group = null ) |
checks how many employees in a population are available for work
population | the populatio to check |
group | the group, null for all groups |
Implemented in CityBuilderCore.DefaultPopulationManager.
int CityBuilderCore.IEmploymentManager.GetEmployed | ( | Population | population, |
EmploymentGroup | group = null ) |
checks how many employees in a population are currently employed
population | the populatio to check |
group | the group, null for all groups |
Implemented in CityBuilderCore.DefaultPopulationManager.
float CityBuilderCore.IEmploymentManager.GetEmploymentRate | ( | Population | population | ) |
calculates employment rate for a population(needed/available) 100 jobs for 200 employees > 0.5
300 jobs for 100 employees > 3.0
population | the populatio to check |
Implemented in CityBuilderCore.DefaultPopulationManager.
int CityBuilderCore.IEmploymentManager.GetNeeded | ( | Population | population, |
EmploymentGroup | group = null ) |
checks how many employees in a population are currently needed
population | the populatio to check |
group | the group, null for all groups |
Implemented in CityBuilderCore.DefaultPopulationManager.
int CityBuilderCore.IEmploymentManager.GetPriority | ( | EmploymentGroup | group | ) |
checks the current priority of an employment group
the priority determines in which order employees are assigned
group | the group to check |
Implemented in CityBuilderCore.DefaultPopulationManager.
float CityBuilderCore.IEmploymentManager.GetWorkerRate | ( | Population | population | ) |
calculates worker rate for population(available/needed) 100 jobs for 200 employees > 2.0
300 jobs for 150 employees > 0.5
population | the populatio to check |
Implemented in CityBuilderCore.DefaultPopulationManager.
void CityBuilderCore.IEmploymentManager.RemoveEmployment | ( | IEmployment | employment | ) |
removes an employment that was previously added to the manager, the employment will no longer have any employees assigned
typically called in OnDestroy
employment | the employment that will no longer be managed here |
Implemented in CityBuilderCore.DefaultPopulationManager.
void CityBuilderCore.IEmploymentManager.SetPriority | ( | EmploymentGroup | group, |
int | priority ) |
changes the priority of an employment group
this changes which employment groups employees are distributed to first
group | |
priority |
Implemented in CityBuilderCore.DefaultPopulationManager.