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

Method evalRes

MicropolisCore/src/MicropolisEngine/src/zone.cpp:722–742  ·  view source on GitHub ↗

* Evaluate residential zone. */

Source from the content-addressed store, hash-verified

720 * Evaluate residential zone.
721 */
722short Micropolis::evalRes(const Position &pos, int traf)
723{
724 short value;
725
726 if (traf < 0) {
727 return -3000;
728 }
729
730 value = landValueMap.worldGet(pos.posX, pos.posY);
731 value -= pollutionDensityMap.worldGet(pos.posX, pos.posY);
732
733 if (value < 0) {
734 value = 0; /* Cap at 0 */
735 } else {
736 value = min(value * 32, 6000); /* Cap at 6000 */
737 }
738
739 value = value - 3000;
740
741 return value;
742}
743
744
745/**

Callers

nothing calls this directly

Calls 2

minFunction · 0.85
worldGetMethod · 0.80

Tested by

no test coverage detected