Finish refactoring tools. Add multitools. (as in multiple tools in one)
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.GameObjects.Components.Interactable
|
||||
{
|
||||
public enum Tool : byte
|
||||
{
|
||||
Wrench,
|
||||
Crowbar,
|
||||
Screwdriver,
|
||||
Wirecutter,
|
||||
Welder,
|
||||
Multitool,
|
||||
}
|
||||
|
||||
public class SharedToolComponent : Component
|
||||
{
|
||||
public override string Name => "Tool";
|
||||
public override uint? NetID => ContentNetIDs.TOOL;
|
||||
|
||||
public virtual Tool Behavior { get; set; }
|
||||
}
|
||||
|
||||
[NetSerializable, Serializable]
|
||||
public class ToolComponentState : ComponentState
|
||||
{
|
||||
public float FuelCapacity { get; }
|
||||
public float Fuel { get; }
|
||||
public bool Activated { get; }
|
||||
public Tool Behavior { get; }
|
||||
|
||||
public ToolComponentState(Tool behavior) : base(ContentNetIDs.TOOL)
|
||||
{
|
||||
Behavior = behavior;
|
||||
}
|
||||
|
||||
public ToolComponentState(float fuelCapacity, float fuel, bool activated) : base(ContentNetIDs.TOOL)
|
||||
{
|
||||
FuelCapacity = fuelCapacity;
|
||||
Fuel = fuel;
|
||||
Activated = activated;
|
||||
Behavior = Tool.Welder;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
using System;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.GameObjects.Components
|
||||
{
|
||||
[NetSerializable, Serializable]
|
||||
public class WelderComponentState : ComponentState
|
||||
{
|
||||
public float FuelCapacity { get; }
|
||||
public float Fuel { get; }
|
||||
public bool Activated { get; }
|
||||
|
||||
public WelderComponentState(float fuelCapacity, float fuel, bool activated) : base(ContentNetIDs.WELDER)
|
||||
{
|
||||
FuelCapacity = fuelCapacity;
|
||||
Fuel = fuel;
|
||||
Activated = activated;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -36,7 +36,7 @@
|
||||
public const uint GALACTIC_MARKET = 1031;
|
||||
public const uint HUMANOID_APPEARANCE = 1032;
|
||||
public const uint INSTRUMENTS = 1033;
|
||||
public const uint WELDER = 1034;
|
||||
public const uint TOOL = 1034;
|
||||
public const uint STACK = 1035;
|
||||
public const uint HANDHELD_LIGHT = 1036;
|
||||
public const uint PAPER = 1037;
|
||||
|
||||
Reference in New Issue
Block a user