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

Method wireTool

MicropolisCore/src/MicropolisEngine/src/tool.cpp:1150–1166  ·  view source on GitHub ↗

* Build a wire at a tile. * @param x Horizontal position of the tile to wire. * @param y Vertical position of the tile to wire. * @param effects Storage of effects of wiring the tile. * @return Tool result. */

Source from the content-addressed store, hash-verified

1148 * @return Tool result.
1149 */
1150ToolResult Micropolis::wireTool(short x, short y, ToolEffects *effects)
1151{
1152 if (!testBounds(x, y)) {
1153 return TOOLRESULT_FAILED;
1154 }
1155
1156 ToolResult result = connectTile(x, y, CONNECT_TILE_WIRE, effects);
1157
1158 if (result == TOOLRESULT_OK) {
1159 /* send 'didtool' message */
1160 FrontendMessage *didToolMsg;
1161 didToolMsg = new FrontendMessageDidTool("Wire", x, y);
1162 effects->addFrontendMessage(didToolMsg);
1163 }
1164
1165 return result;
1166}
1167
1168
1169/**

Callers

nothing calls this directly

Calls 2

testBoundsFunction · 0.85
addFrontendMessageMethod · 0.80

Tested by

no test coverage detected