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

Method putDownWater

MicropolisCore/src/MicropolisEngine/src/tool.cpp:302–314  ·  view source on GitHub ↗

* Put down a water tile. * @param mapH X coordinate of the tile. * @param mapV Y coordinate of the tile. * @return Tool result. */

Source from the content-addressed store, hash-verified

300 * @return Tool result.
301 */
302ToolResult Micropolis::putDownWater(short mapH, short mapV,
303 ToolEffects *effects)
304{
305 MapTile tile = effects->getMapTile(mapH, mapV);
306
307 if (tile == RIVER) return TOOLRESULT_FAILED;
308
309 effects->setMapValue(mapH, mapV, RIVER);
310
311 effects->addCost(gCostOf[TOOL_WATER]);
312
313 return TOOLRESULT_OK;
314}
315
316
317/**

Callers

nothing calls this directly

Calls 3

getMapTileMethod · 0.80
addCostMethod · 0.80
setMapValueMethod · 0.60

Tested by

no test coverage detected