Files
tbd-station-14/Content.Server/GameObjects/Components/Interactable/Tools/BaseTool.cs
ZelteHonor b2e2aef78d Rider static analysis (#433)
* Non-accessed local variable

* Merge cast and type checks.

* StringComparison.Ordinal added for better culture support

* Supposed code improvement in launcher. Remove unused code.

* Update ExplosionHelper.cs

Unintentional change.

* Optimized Import

* Add Robust.Shared.Utility import where it was deleted

* Other random suggestion

* Improve my comment
2019-11-13 23:37:46 +01:00

40 lines
1.2 KiB
C#

// Only unused on .NET Core due to KeyValuePair.Deconstruct
// ReSharper disable once RedundantUsingDirective
using Robust.Shared.Utility;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;
namespace Content.Server.GameObjects.Components.Interactable.Tools
{
public abstract class ToolComponent : Component
{
/// <summary>
/// For tool interactions that have a delay before action this will modify the rate, time to wait is divided by this value
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
public float SpeedModifier
{
get => _speedModifier;
set => _speedModifier = value;
}
private float _speedModifier = 1;
public override void ExposeData(ObjectSerializer serializer)
{
base.ExposeData(serializer);
serializer.DataField(ref _speedModifier, "Speed", 1);
}
/// <summary>
/// Status modifier which determines whether or not we can act as a tool at this time
/// </summary>
/// <returns></returns>
public virtual bool CanUse()
{
return true;
}
}
}