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

Function getDensityStr

micropolis-activity/src/sim/w_tool.c:732–766  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

730
731
732int getDensityStr(short catNo, short mapH, short mapV)
733{
734 int z;
735
736 switch(catNo) {
737 case 0:
738 z = PopDensity[mapH >>1][mapV >>1];
739 z = z >> 6;
740 z = z & 3;
741 return (z);
742 case 1:
743 z = LandValueMem[mapH >>1][mapV >>1];
744 if (z < 30) return (4);
745 if (z < 80) return (5);
746 if (z < 150) return (6);
747 return (7);
748 case 2:
749 z = CrimeMem[mapH >>1][mapV >>1];
750 z = z >> 6;
751 z = z & 3;
752 return (z + 8);
753 case 3:
754 z = PollutionMem[mapH >>1][mapV >>1];
755 if ((z < 64) && (z > 0)) return (13);
756 z = z >> 6;
757 z = z & 3;
758 return (z + 12);
759 case 4:
760 z = RateOGMem[mapH >>3][mapV >>3];
761 if (z < 0) return (16);
762 if (z == 0) return (17);
763 if (z > 100) return (19);
764 return (18);
765 }
766}
767
768
769doZoneStatus(short mapH, short mapV)

Callers 1

w_tool.cFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected