////////////////////// // Auxiliar Methods // ////////////////////// void InitLaboralSector(INDUSTRY industry, SECTOR_INVESTMENT investment) { float investmentValue = 0f, developementValue = 0; switch (industry) { case INDUSTRY.UNDER_DEVELOPED: developementValue = 0.25f; break; case INDUSTRY.DEVELOPING: developementValue = 0.5f; break; case INDUSTRY.DEVELOPED: developementValue = 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; } IndustrySector = new IndustrySector(investmentValue, developementValue, CityPlace, city); }
////////////////// // 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(); }