2021-02-27 04:12:09 +01:00
|
|
|
|
#nullable enable
|
|
|
|
|
|
using Content.Shared.GameObjects.EntitySystems;
|
2021-01-11 22:14:01 +11:00
|
|
|
|
using Content.Shared.Interfaces.GameObjects.Components;
|
|
|
|
|
|
using Robust.Shared.GameObjects;
|
2021-03-05 01:08:38 +01:00
|
|
|
|
using Robust.Shared.Serialization.Manager.Attributes;
|
2021-01-11 22:14:01 +11:00
|
|
|
|
using Robust.Shared.ViewVariables;
|
2020-08-19 18:13:22 -04:00
|
|
|
|
|
|
|
|
|
|
namespace Content.Shared.GameObjects.Components.Movement
|
|
|
|
|
|
{
|
2021-03-05 01:08:38 +01:00
|
|
|
|
public interface IClimbable { }
|
2020-08-19 18:13:22 -04:00
|
|
|
|
|
2021-01-11 22:14:01 +11:00
|
|
|
|
public abstract class SharedClimbableComponent : Component, IClimbable, IDragDropOn
|
2020-08-19 18:13:22 -04:00
|
|
|
|
{
|
|
|
|
|
|
public sealed override string Name => "Climbable";
|
2021-01-11 22:14:01 +11:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The range from which this entity can be climbed.
|
|
|
|
|
|
/// </summary>
|
2021-03-05 01:08:38 +01:00
|
|
|
|
[ViewVariables] [DataField("range")] protected float Range = SharedInteractionSystem.InteractionRange / 1.4f;
|
2021-01-11 22:14:01 +11:00
|
|
|
|
|
|
|
|
|
|
public virtual bool CanDragDropOn(DragDropEventArgs eventArgs)
|
|
|
|
|
|
{
|
|
|
|
|
|
return eventArgs.Dragged.HasComponent<SharedClimbingComponent>();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public abstract bool DragDropOn(DragDropEventArgs eventArgs);
|
2020-08-19 18:13:22 -04:00
|
|
|
|
}
|
|
|
|
|
|
}
|