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

Method doTool

MicropolisCore/src/MicropolisEngine/src/tool.cpp:1375–1484  ·  view source on GitHub ↗

* Apply a tool. * @param tool Tool to use. * @param tileX Horizontal position in the city map. * @param tileY Vertical position in the city map. * @return Tool result. */

Source from the content-addressed store, hash-verified

1373 * @return Tool result.
1374 */
1375ToolResult Micropolis::doTool(EditingTool tool, short tileX, short tileY)
1376{
1377 ToolEffects effects(this);
1378 ToolResult result;
1379
1380 switch (tool) {
1381
1382 case TOOL_RESIDENTIAL:
1383 result = buildBuildingTool(tileX, tileY, &residentialZoneBuilding,
1384 &effects);
1385 break;
1386
1387 case TOOL_COMMERCIAL:
1388 result = buildBuildingTool(tileX, tileY, &commercialZoneBuilding,
1389 &effects);
1390 break;
1391
1392 case TOOL_INDUSTRIAL:
1393 result = buildBuildingTool(tileX, tileY, &industrialZoneBuilding,
1394 &effects);
1395 break;
1396
1397 case TOOL_FIRESTATION:
1398 result = buildBuildingTool(tileX, tileY, &fireStationBuilding,
1399 &effects);
1400 break;
1401
1402 case TOOL_POLICESTATION:
1403 result = buildBuildingTool(tileX, tileY, &policeStationBuilding,
1404 &effects);
1405 break;
1406
1407 case TOOL_QUERY:
1408 return queryTool(tileX, tileY);
1409
1410 case TOOL_WIRE:
1411 result = wireTool(tileX, tileY, &effects);
1412 break;
1413
1414 case TOOL_BULLDOZER:
1415 result = bulldozerTool(tileX, tileY, &effects);
1416 break;
1417
1418 case TOOL_RAILROAD:
1419 result = railroadTool(tileX, tileY, &effects);
1420 break;
1421
1422 case TOOL_ROAD:
1423 result = roadTool(tileX, tileY, &effects);
1424 break;
1425
1426 case TOOL_STADIUM:
1427 result = buildBuildingTool(tileX, tileY, &stadiumBuilding,
1428 &effects);
1429 break;
1430
1431 case TOOL_PARK:
1432 result = parkTool(tileX, tileY, &effects);

Callers

nothing calls this directly

Calls 1

modifyIfEnoughFundingMethod · 0.80

Tested by

no test coverage detected