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

@@ -0,0 +1,32 @@
using System;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization;
namespace Content.Shared.GameObjects.Components.Storage
{
public abstract class SharedStorableComponent : Component
{
public override string Name => "Storable";
public override uint? NetID => ContentNetIDs.STORABLE;
public virtual int Size { get; set; }
public override void ExposeData(ObjectSerializer serializer)
{
base.ExposeData(serializer);
serializer.DataField(this, s => s.Size, "size", 1);
}
}
[Serializable, NetSerializable]
public class StorableComponentState : ComponentState
{
public readonly int Size;
public StorableComponentState(int size) : base(ContentNetIDs.STORABLE)
{
Size = size;
}
}
}