////////////////// // Constructors // ////////////////// public CityPart(PLACE cityPlace, POPULATION population, Citizen.ECONOMIC_CLASS populationWealth, INDUSTRY industry, SECTOR_INVESTMENT industryInvestment, FUN fun, SECTOR_INVESTMENT leisureInvestment, INFRASTRUCTURE infrastructure, SECTOR_INVESTMENT transportInvestment, City city) { this.city = city; CityPlace = cityPlace; Citizens = new Dictionary <int, Citizen>(); nonAllocatedHomes = new List <Coords>(); cityHomesGrid = new int[32, 32]; GlobalHappiness = new RepresentativeIndex("Felicidad Global", "Felicidad Global en el barrio " + CityPlace, 0.5f); GlobalHealth = new RepresentativeIndex("Salud Global", "Salud Global en el barrio " + CityPlace, 0.5f); LowClassProportion = new RepresentativeIndex("Clase Baja", "Proporción de ciudadanos de clase baja en el barrio " + CityPlace, 0.5f); MiddleClassProportion = new RepresentativeIndex("Clase Media", "Proporción de ciudadanos de clase media en el barrio " + CityPlace, 0.5f); HighClassProportion = new RepresentativeIndex("Clase Alta", "Proporción de ciudadanos de clase alta en el barrio " + CityPlace, 0.5f); InitLaboralSector(industry, industryInvestment); InitTransportSector(infrastructure, transportInvestment); InitLeisureSector(fun, leisureInvestment); InitPopulation(population, populationWealth); // It has to be the last initialization //ProcessDay(); }
void InitTransportSector(INFRASTRUCTURE infrastructure, SECTOR_INVESTMENT investment) { float investmentValue = 0f, infrastructureValue = 0; switch (infrastructure) { case INFRASTRUCTURE.OLD_FASHINED: infrastructureValue = 0.25f; break; case INFRASTRUCTURE.UP_TO_DATE: infrastructureValue = 0.5f; break; case INFRASTRUCTURE.CUTTING_EDGE: infrastructureValue = 0.75f; break; } switch (investment) { case SECTOR_INVESTMENT.LOW: investmentValue = 0.25f; break; case SECTOR_INVESTMENT.MEDIUM: investmentValue = 0.5f; break; case SECTOR_INVESTMENT.HIGH: investmentValue = 0.75f; break; } TransportSector = new TransportSector(investmentValue, infrastructureValue, CityPlace); }