* 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. */
| 1148 | * @return Tool result. |
| 1149 | */ |
| 1150 | ToolResult 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 | /** |
nothing calls this directly
no test coverage detected