Files
tbd-station-14/Content.Shared/Cuffs/Components/SharedCuffableComponent.cs
metalgearsloth b2322864e9 Remove IActionBlocker.CanMove (#4449)
* Remove IActionBlocker.CanMove

Ported the remainders over to using MovementAttemptEvent which should also help make mob movement a bit faster.

* Make that check faster
2021-08-09 17:34:01 -07:00

51 lines
1.7 KiB
C#

using System;
using Content.Shared.ActionBlocker;
using Content.Shared.Pulling.Components;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Maths;
using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;
namespace Content.Shared.Cuffs.Components
{
[NetworkedComponent()]
public class SharedCuffableComponent : Component, IActionBlocker
{
public override string Name => "Cuffable";
[ViewVariables]
public bool CanStillInteract { get; set; } = 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)
{
NumHandsCuffed = numHandsCuffed;
CanStillInteract = canStillInteract;
RSI = rsiPath;
IconState = iconState;
Color = color;
}
}
}
}