2021-01-11 22:14:01 +11:00
|
|
|
|
using Content.Shared.GameObjects.EntitySystems;
|
|
|
|
|
|
using Content.Shared.Interfaces.GameObjects.Components;
|
|
|
|
|
|
using Robust.Shared.GameObjects;
|
|
|
|
|
|
using Robust.Shared.Serialization;
|
|
|
|
|
|
using Robust.Shared.ViewVariables;
|
2020-08-19 18:13:22 -04:00
|
|
|
|
|
|
|
|
|
|
namespace Content.Shared.GameObjects.Components.Movement
|
|
|
|
|
|
{
|
|
|
|
|
|
public interface IClimbable { };
|
|
|
|
|
|
|
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>
|
|
|
|
|
|
[ViewVariables]
|
|
|
|
|
|
protected float Range;
|
|
|
|
|
|
|
|
|
|
|
|
public override void ExposeData(ObjectSerializer serializer)
|
|
|
|
|
|
{
|
|
|
|
|
|
base.ExposeData(serializer);
|
|
|
|
|
|
serializer.DataField(ref Range, "range", SharedInteractionSystem.InteractionRange / 1.4f);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
|
}
|