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

Detailed Description

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

Inheritance diagram for CityBuilderCore.IEmploymentManager:
CityBuilderCore.DefaultPopulationManager

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)
 

Member Function Documentation

◆ AddEmployment()

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

Parameters
employmentthe employment to add to the manager

Implemented in CityBuilderCore.DefaultPopulationManager.

◆ CheckEmployment()

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.

◆ GetAvailable()

int CityBuilderCore.IEmploymentManager.GetAvailable ( Population population,
EmploymentGroup group = null )

checks how many employees in a population are available for work

Parameters
populationthe populatio to check
groupthe group, null for all groups
Returns
employee count available for work

Implemented in CityBuilderCore.DefaultPopulationManager.

◆ GetEmployed()

int CityBuilderCore.IEmploymentManager.GetEmployed ( Population population,
EmploymentGroup group = null )

checks how many employees in a population are currently employed

Parameters
populationthe populatio to check
groupthe group, null for all groups
Returns
employee count currently employed

Implemented in CityBuilderCore.DefaultPopulationManager.

◆ GetEmploymentRate()

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

Parameters
populationthe populatio to check
Returns
employment rate(below 1 when more people than jobs)

Implemented in CityBuilderCore.DefaultPopulationManager.

◆ GetNeeded()

int CityBuilderCore.IEmploymentManager.GetNeeded ( Population population,
EmploymentGroup group = null )

checks how many employees in a population are currently needed

Parameters
populationthe populatio to check
groupthe group, null for all groups
Returns
employee count currently needed

Implemented in CityBuilderCore.DefaultPopulationManager.

◆ GetPriority()

int CityBuilderCore.IEmploymentManager.GetPriority ( EmploymentGroup group)

checks the current priority of an employment group
the priority determines in which order employees are assigned

Parameters
groupthe group to check
Returns
current priority

Implemented in CityBuilderCore.DefaultPopulationManager.

◆ GetWorkerRate()

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

Parameters
populationthe populatio to check
Returns
worker rate(below 1 when more jobs than people)

Implemented in CityBuilderCore.DefaultPopulationManager.

◆ RemoveEmployment()

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

Parameters
employmentthe employment that will no longer be managed here

Implemented in CityBuilderCore.DefaultPopulationManager.

◆ SetPriority()

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

Parameters
group
priority

Implemented in CityBuilderCore.DefaultPopulationManager.