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

Method computeComRateMap

MicropolisCore/src/MicropolisEngine/src/scan.cpp:575–587  ·  view source on GitHub ↗

* Compute distance to city center for the entire map. * @see comRateMap */

Source from the content-addressed store, hash-verified

573 * @see comRateMap
574 */
575void Micropolis::computeComRateMap()
576{
577 short x, y, z;
578
579 for (x = 0; x < comRateMap.MAP_W; x++) {
580 for (y = 0; y < comRateMap.MAP_H; y++) {
581 z = (short)(getCityCenterDistance(x * 8,y * 8) / 2); // 0..32
582 z = z * 4; // 0..128
583 z = 64 - z; // 64..-64
584 comRateMap.set(x, y, z);
585 }
586 }
587}
588
589
590////////////////////////////////////////////////////////////////////////

Callers

nothing calls this directly

Calls 1

setMethod · 0.80

Tested by

no test coverage detected