Refactor drag and drop to use a shared interface (#2012)

* WIP in progress hours

* Cleanup

* Fix bugle

* Fix nullable error

* Merge fixes

* Merge fixes

* Merge fixes
This commit is contained in:
DrSmugleaf
2020-10-14 15:24:07 +02:00
committed by GitHub
parent f715eed63c
commit cdedaeb12e
37 changed files with 527 additions and 377 deletions

View File

@@ -5,10 +5,11 @@ using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Components;
using Robust.Shared.Physics;
using Robust.Shared.Serialization;
using Content.Shared.Interfaces.GameObjects.Components;
namespace Content.Shared.GameObjects.Components.Movement
{
public abstract class SharedClimbingComponent : Component, IActionBlocker, ICollideSpecial
public abstract class SharedClimbingComponent : Component, IActionBlocker, ICollideSpecial, IDraggable
{
public sealed override string Name => "Climbing";
public sealed override uint? NetID => ContentNetIDs.CLIMBING;
@@ -45,6 +46,16 @@ namespace Content.Shared.GameObjects.Components.Movement
return false;
}
bool IDraggable.CanDrop(CanDropEventArgs args)
{
return args.Target.HasComponent<IClimbable>();
}
bool IDraggable.Drop(DragDropEventArgs args)
{
return false;
}
public override void Initialize()
{
base.Initialize();