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

Method incRateOfGrowth

MicropolisCore/src/MicropolisEngine/src/zone.cpp:337–343  ·  view source on GitHub ↗

* Update the rate of growth at position \a pos by \a amount. * @param pos Position to modify. * @param amount Amount of change (can both be positive and negative). */

Source from the content-addressed store, hash-verified

335 * @param amount Amount of change (can both be positive and negative).
336 */
337void Micropolis::incRateOfGrowth(const Position &pos, int amount)
338{
339 int value = rateOfGrowthMap.worldGet(pos.posX, pos.posY);
340
341 value = clamp(value + amount * 4, -200, 200);
342 rateOfGrowthMap.worldSet(pos.posX, pos.posY, value);
343}
344
345
346/**

Callers

nothing calls this directly

Calls 3

clampFunction · 0.85
worldGetMethod · 0.80
worldSetMethod · 0.80

Tested by

no test coverage detected