Refactor a bunch of stuff.

This commit is contained in:
zumorica
2020-05-19 13:55:52 +02:00
parent 06c7030514
commit 06d2cc74ed
17 changed files with 153 additions and 347 deletions

View File

@@ -4,32 +4,33 @@ using Robust.Shared.Serialization;
namespace Content.Shared.GameObjects.Components.Interactable
{
public enum Tool : byte
[Flags]
public enum ToolQuality : byte
{
Wrench,
Crowbar,
Screwdriver,
Wirecutter,
Welder,
Multitool,
None = 0,
Anchoring = 1,
Prying = 1 << 1,
Screwing = 1 << 2,
Cutting = 1 << 3,
Welding = 1 << 4,
Multitool = 1 << 5,
}
public class SharedToolComponent : Component
{
public override string Name => "Tool";
public override uint? NetID => ContentNetIDs.TOOL;
public virtual Tool Behavior { get; set; }
public virtual ToolQuality Qualities { get; set; }
}
[NetSerializable, Serializable]
public class ToolComponentState : ComponentState
public class MultiToolComponentState : ComponentState
{
public Tool Behavior { get; }
public ToolQuality Quality { get; }
public ToolComponentState(Tool behavior) : base(ContentNetIDs.TOOL)
public MultiToolComponentState(ToolQuality quality) : base(ContentNetIDs.MULTITOOLS)
{
Behavior = behavior;
Quality = quality;
}
}
@@ -39,14 +40,14 @@ namespace Content.Shared.GameObjects.Components.Interactable
public float FuelCapacity { get; }
public float Fuel { get; }
public bool Activated { get; }
public Tool Behavior { get; }
public ToolQuality Quality { get; }
public WelderComponentState(float fuelCapacity, float fuel, bool activated) : base(ContentNetIDs.WELDER)
{
FuelCapacity = fuelCapacity;
Fuel = fuel;
Activated = activated;
Behavior = Tool.Welder;
Quality = ToolQuality.Welding;
}
}
}