MCPcopy Create free account
hub / github.com/SimHacker/micropolis / getCityClass

Method getCityClass

MicropolisCore/src/MicropolisEngine/src/evaluate.cpp:200–221  ·  view source on GitHub ↗

* Classify the city based on its population. * @param cityPopulation Number of people in the city. * @return City classification. * @todo Put people counts into a table. */

Source from the content-addressed store, hash-verified

198 * @todo Put people counts into a table.
199 */
200CityClass Micropolis::getCityClass(Quad cityPopulation)
201{
202 CityClass cityClassification = CC_VILLAGE;
203
204 if (cityPopulation > 2000) {
205 cityClassification = CC_TOWN;
206 }
207 if (cityPopulation > 10000) {
208 cityClassification = CC_CITY;
209 }
210 if (cityPopulation > 50000) {
211 cityClassification = CC_CAPITAL;
212 }
213 if (cityPopulation > 100000) {
214 cityClassification = CC_METROPOLIS;
215 }
216 if (cityPopulation > 500000) {
217 cityClassification = CC_MEGALOPOLIS;
218 }
219
220 return cityClassification;
221}
222
223/**
224 * Evaluate problems of the city, take votes, and decide which are the most

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected