Finish refactoring tools. Add multitools. (as in multiple tools in one)

This commit is contained in:
zumorica
2020-04-29 13:43:07 +02:00
parent ca5638badf
commit ff5549a0d1
37 changed files with 840 additions and 467 deletions

View File

@@ -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;
}
}
}