Files
tbd-station-14/Content.Shared/GameObjects/Components/ActionBlocking/SharedCuffableComponent.cs
DrSmugleaf 74943a2770 Typo, redundant string interpolation, namespaces and imports cleanup (#2068)
* Readonly, typos and redundant string interpolations

* Namespaces

* Optimize imports

* Address reviews

* but actually

* Localize missing strings

* Remove redundant vars
2020-09-13 14:23:52 +02:00

50 lines
1.7 KiB
C#

using System;
using Content.Shared.GameObjects.EntitySystems;
using Robust.Shared.GameObjects;
using Robust.Shared.Maths;
using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;
namespace Content.Shared.GameObjects.Components.ActionBlocking
{
public class SharedCuffableComponent : Component, IActionBlocker
{
public override string Name => "Cuffable";
public override uint? NetID => ContentNetIDs.CUFFED;
[ViewVariables]
public bool CanStillInteract = true;
#region ActionBlockers
bool IActionBlocker.CanInteract() => CanStillInteract;
bool IActionBlocker.CanUse() => CanStillInteract;
bool IActionBlocker.CanPickup() => CanStillInteract;
bool IActionBlocker.CanDrop() => CanStillInteract;
bool IActionBlocker.CanAttack() => CanStillInteract;
bool IActionBlocker.CanEquip() => CanStillInteract;
bool IActionBlocker.CanUnequip() => CanStillInteract;
#endregion
[Serializable, NetSerializable]
protected sealed class CuffableComponentState : ComponentState
{
public bool CanStillInteract { get; }
public int NumHandsCuffed { get; }
public string RSI { get; }
public string IconState { get; }
public Color Color { get; }
public CuffableComponentState(int numHandsCuffed, bool canStillInteract, string rsiPath, string iconState, Color color) : base(ContentNetIDs.CUFFED)
{
NumHandsCuffed = numHandsCuffed;
CanStillInteract = canStillInteract;
RSI = rsiPath;
IconState = iconState;
Color = color;
}
}
}
}