public static string GetWorkplacesLabel(int educationLevel) { DistrictEducationData districtEducationData = JobsUtils.GetEducationData(educationLevel); int wp = GetWorkplacesByLevel(educationLevel); var percent = wp == 0 ? " - " : ((int)(districtEducationData.m_finalEligibleWorkers / ((float)wp) * 100)).ToString(); return(percent + "% (" + districtEducationData.m_finalEligibleWorkers + "/" + wp + ")"); }
public override void Update() { if (isVisible && isEnabled) { BuildingsInfoManager.calculateAllWorkplaces(); for (int i = 0; i < m_EmploymentLabels.Length; i++) { m_EmploymentLabels[i].text = JobsUtils.educationLevelNames[i]; m_EmploymentValues[i].text = ": " + JobsUtils.GetEmploymentLabel(i); m_WorkplaceValues[i].text = BuildingsInfoManager.GetWorkplacesLabel(i); } } }
public static float GetPercent(int educationLevel) { DistrictEducationData districtEducationData = JobsUtils.GetEducationData(educationLevel); int wp = GetWorkplacesByLevel(educationLevel); float percent; if (wp == 0) { percent = districtEducationData.m_finalEligibleWorkers == 0 ? 0 : 1; } else { percent = districtEducationData.m_finalEligibleWorkers / (float)wp; } return(percent); }
public static string GetWorkplacesLabel(int educationLevel) { DistrictEducationData ded = JobsUtils.GetEducationData(educationLevel); int wp = getWorkplacesByLevel(educationLevel); string percent; if (wp == 0) { percent = " - "; } else { percent = ((int)((float)ded.m_finalEligibleWorkers / ((float)wp) * 100)).ToString(); } return(percent + "% (" + ded.m_finalEligibleWorkers + "/" + wp + ")"); }
public override void Update() { if (isVisible && isEnabled) { for (int i = 0; i < m_EmploymentLabels.Length; i++) { m_EmploymentLabels[i].text = JobsUtils.EducationLevelNames[i]; m_EmploymentValues[i].text = ": " + JobsUtils.GetEmploymentLabel(i); m_WorkplaceValues[i].text = BuildingsInfoManager.GetWorkplacesLabel(i); m_WorkspaceDetailLabels[i].text = JobsUtils.EducationLevelNames[i]; m_WorkspacesDetailValues[0, i].text = BuildingsInfoManager.comWorkplaces[i].ToString(); m_WorkspacesDetailValues[1, i].text = BuildingsInfoManager.offWorkplaces[i].ToString(); m_WorkspacesDetailValues[2, i].text = BuildingsInfoManager.indWorkplaces[i].ToString(); m_WorkspacesDetailValues[3, i].text = BuildingsInfoManager.GetServiceWorkspaceCount(i).ToString(); m_WorkspacesDetailValues[4, i].text = BuildingsInfoManager.GetWorkplacesByLevel(i).ToString(); } } }
public override void Update() { if (isVisible && isEnabled) { for (int i = 0; i < m_RadialChart.Length; i++) { float percent; switch (RadialChartPrefix) { case "workplaces": percent = BuildingsInfoManager.GetPercent(i); break; default: percent = JobsUtils.GetPercentEmployedF(i); break; } m_RadialChart[i].SetValues(new float[] { percent, 1f - percent }); } } }