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

Method doResIn

MicropolisCore/src/MicropolisEngine/src/zone.cpp:600–632  ·  view source on GitHub ↗

* Perform residential immigration into the current residential tile. * @param pos Position of the tile. * @param pop Population ? * @param value Land value corrected for pollution. */

Source from the content-addressed store, hash-verified

598 * @param value Land value corrected for pollution.
599 */
600void Micropolis::doResIn(const Position &pos, int pop, int value)
601{
602 short pollution = pollutionDensityMap.worldGet(pos.posX, pos.posY);
603
604 if (pollution > 128) {
605 return;
606 }
607
608 MapTile tile = map[pos.posX][pos.posY] & LOMASK;
609
610 if (tile == FREEZ) {
611
612 if (pop < 8) {
613 buildHouse(pos, value);
614 incRateOfGrowth(pos, 1);
615 return;
616 }
617
618 if (populationDensityMap.worldGet(pos.posX, pos.posY) > 64) {
619 resPlop(pos, 0, value);
620 incRateOfGrowth(pos, 8);
621 return;
622 }
623
624 return;
625 }
626
627 if (pop < 40) {
628 resPlop(pos, (pop / 8) - 1, value);
629 incRateOfGrowth(pos, 8);
630 }
631
632}
633
634
635/**

Callers

nothing calls this directly

Calls 1

worldGetMethod · 0.80

Tested by

no test coverage detected