Select the specified tool, putting the existing current tool into standby
| 227 | |
| 228 | // Select the specified tool, putting the existing current tool into standby |
| 229 | void MovementState::SelectTool(int toolNumber, bool simulating) noexcept |
| 230 | { |
| 231 | ReadLockedPointer<Tool> const newTool = Tool::GetLockedTool(toolNumber); |
| 232 | if (!simulating && currentTool != nullptr && currentTool != newTool.Ptr()) |
| 233 | { |
| 234 | currentTool->Standby(); |
| 235 | } |
| 236 | currentTool = newTool.Ptr(); // must do this first so that Activate() will always work |
| 237 | if (!simulating && newTool.IsNotNull()) |
| 238 | { |
| 239 | newTool->Activate(); |
| 240 | } |
| 241 | } |
| 242 | |
| 243 | // Get a locked pointer to the current tool, or null if there is no current tool |
| 244 | ReadLockedPointer<Tool> MovementState::GetLockedCurrentTool() const noexcept |
no test coverage detected