From 659d623784b817c66bf6f940526d972eb581ba52 Mon Sep 17 00:00:00 2001 From: zumorica Date: Wed, 29 Apr 2020 15:34:49 +0200 Subject: [PATCH] Cleanup construction component --- .../Construction/ConstructionComponent.cs | 44 ++----------------- 1 file changed, 4 insertions(+), 40 deletions(-) diff --git a/Content.Server/GameObjects/Components/Construction/ConstructionComponent.cs b/Content.Server/GameObjects/Components/Construction/ConstructionComponent.cs index 7281fe695d..f3f28db670 100644 --- a/Content.Server/GameObjects/Components/Construction/ConstructionComponent.cs +++ b/Content.Server/GameObjects/Components/Construction/ConstructionComponent.cs @@ -144,46 +144,10 @@ namespace Content.Server.GameObjects.Components.Construction case ConstructionStepTool toolStep: if (!slapped.TryGetComponent(out var tool)) return false; - switch (toolStep.Tool) - { - case Tool.Crowbar: - if (tool.Behavior == Tool.Crowbar) - { - tool.PlayUseSound(); - return true; - } - return false; - case Tool.Welder: - if (tool.Behavior == Tool.Welder && tool.TryWeld(toolStep.Amount)) - { - tool.PlayUseSound(); - return true; - } - return false; - case Tool.Wrench: - if (tool.Behavior == Tool.Wrench) - { - tool.PlayUseSound(); - return true; - } - return false; - case Tool.Screwdriver: - if (tool.Behavior == Tool.Screwdriver) - { - tool.PlayUseSound(); - return true; - } - return false; - case Tool.Wirecutter: - if (tool.Behavior == Tool.Wirecutter) - { - tool.PlayUseSound(); - return true; - } - return false; - default: - throw new NotImplementedException(); - } + if (toolStep.Tool != tool.Behavior) return false; + tool.PlayUseSound(); + return true; + default: throw new NotImplementedException(); }