/// <summary> /// Returns the workplace breakdowns and visitor count for the given building prefab and level. /// </summary> /// <param name="buildingPrefab">Building prefab record</param> /// <param name="level">Building level</param> /// <returns>Workplace breakdowns and visitor count </returns> public override int[] Workplaces(BuildingInfo buildingPrefab, int level) { int[] array = LegacyAIUtils.GetOfficeArray(buildingPrefab, level); LegacyAIUtils.CalculateprefabWorkerVisit(buildingPrefab.GetWidth(), buildingPrefab.GetLength(), ref buildingPrefab, 10, ref array, out int[] output); return(output); }
/// <summary> /// Returns the volumetric population of the given building prefab and level. /// </summary> /// <param name="buildingPrefab">Building prefab record</param> /// <param name="level">Building level</param> /// <param name="multiplier">Ignored</param> /// <returns>Population</returns> public override int Population(BuildingInfo buildingPrefab, int level, float multiplier) { // First, check for volumetric population override - that trumps everything else. int value = PopData.instance.GetOverride(buildingPrefab.name); if (value == 0) { // No volumetric override - use legacy calcs. int[] array = LegacyAIUtils.GetResidentialArray(buildingPrefab, (int)level); return(LegacyAIUtils.CalculatePrefabHousehold(buildingPrefab.GetWidth(), buildingPrefab.GetWidth(), ref buildingPrefab, ref array)); } return(value); }
/// <summary> /// Returns the workplace breakdowns and visitor count for the given building prefab and level. /// </summary> /// <param name="buildingPrefab">Building prefab record</param> /// <param name="level">Building level</param> /// <returns>Workplace breakdowns and visitor count </returns> public override int[] Workplaces(BuildingInfo buildingPrefab, int level) { int[] array; int minWorkers; // Need to test if we're an extractor or not for this one. if (buildingPrefab.GetAI() is IndustrialExtractorAI) { array = LegacyAIUtils.GetExtractorArray(buildingPrefab); minWorkers = 3; } else { array = LegacyAIUtils.GetIndustryArray(buildingPrefab, level); minWorkers = 4; } LegacyAIUtils.CalculateprefabWorkerVisit(buildingPrefab.GetWidth(), buildingPrefab.GetLength(), ref buildingPrefab, minWorkers, ref array, out int[] output); return(output); }