Files
tbd-station-14/Content.Shared/Climbing/SharedClimbableComponent.cs
2021-12-03 12:23:18 +01:00

29 lines
952 B
C#

using Content.Shared.DragDrop;
using Content.Shared.Interaction;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.ViewVariables;
namespace Content.Shared.Climbing
{
public interface IClimbable { }
public abstract class SharedClimbableComponent : Component, IClimbable, IDragDropOn
{
public sealed override string Name => "Climbable";
/// <summary>
/// The range from which this entity can be climbed.
/// </summary>
[ViewVariables] [DataField("range")] protected float Range = SharedInteractionSystem.InteractionRange / 1.4f;
public virtual bool CanDragDropOn(DragDropEvent eventArgs)
{
return IoCManager.Resolve<IEntityManager>().HasComponent<SharedClimbingComponent>(eventArgs.Dragged.Uid);
}
public abstract bool DragDropOn(DragDropEvent eventArgs);
}
}