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

Method putDownNetwork

MicropolisCore/src/MicropolisEngine/src/tool.cpp:274–293  ·  view source on GitHub ↗

* Put down a communication network. * @param mapH X coordinate of the tile. * @param mapV Y coordinate of the tile. * @return Tool result. * @param effects Storage of effects of putting down the park. * @todo Auto-bulldoze costs should be pulled from a table/constant. */

Source from the content-addressed store, hash-verified

272 * @todo Auto-bulldoze costs should be pulled from a table/constant.
273 */
274ToolResult Micropolis::putDownNetwork(short mapH, short mapV,
275 ToolEffects *effects)
276{
277 MapTile tile = effects->getMapTile(mapH, mapV);
278
279 if (tile != DIRT && tally(tile)) {
280 effects->addCost(gCostOf[TOOL_BULLDOZER]);
281 effects->setMapValue(mapH, mapV, DIRT);
282 tile = DIRT;
283 }
284
285 if (tile != DIRT) return TOOLRESULT_NEED_BULLDOZE;
286
287 effects->setMapValue(mapH, mapV,
288 TELEBASE | CONDBIT | BURNBIT | BULLBIT | ANIMBIT);
289
290 effects->addCost(gCostOf[TOOL_NETWORK]);
291
292 return TOOLRESULT_OK;
293}
294
295
296/**

Callers

nothing calls this directly

Calls 4

tallyFunction · 0.85
getMapTileMethod · 0.80
addCostMethod · 0.80
setMapValueMethod · 0.60

Tested by

no test coverage detected