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

Method buildBuildingTool

MicropolisCore/src/MicropolisEngine/src/tool.cpp:1203–1217  ·  view source on GitHub ↗

* Build a building. * @param x Horizontal position of center tile of the new building. * @param y Vertical position of center tile of the new building. * @param buildingProps Building properties of the building being constructed. * @param effects Storage of effects of putting down the building. * @return Tool result. */

Source from the content-addressed store, hash-verified

1201 * @return Tool result.
1202 */
1203ToolResult Micropolis::buildBuildingTool(short x, short y,
1204 const BuildingProperties *buildingProps,
1205 ToolEffects *effects)
1206{
1207 ToolResult result = buildBuilding(x, y, buildingProps, effects);
1208
1209 if (result == TOOLRESULT_OK) {
1210 /* send 'didtool' message */
1211 FrontendMessage *didToolMsg;
1212 didToolMsg = new FrontendMessageDidTool(buildingProps->toolName, x, y);
1213 effects->addFrontendMessage(didToolMsg);
1214 }
1215
1216 return result;
1217}
1218
1219/** Building properties of a residential zone. */
1220static const BuildingProperties residentialZoneBuilding =

Callers

nothing calls this directly

Calls 1

addFrontendMessageMethod · 0.80

Tested by

no test coverage detected