Storage system refactor & map init.

* Demonstrated map init working with guns, toolboxes, tool lockers.
* Refactored EntityStorage and ServerStorage to have a common interface.
* EntityStorage no longer uses ServerStorage PURELY for visuals.
  Use an appearance visualizer instead.
This commit is contained in:
Pieter-Jan Briers
2019-05-05 18:52:06 +02:00
parent 030f1f2a57
commit e35d5390db
17 changed files with 384 additions and 950 deletions

View File

@@ -9,29 +9,6 @@ namespace Content.Shared.GameObjects.Components.Storage
{
public override string Name => "Storage";
public override uint? NetID => ContentNetIDs.INVENTORY;
public override Type StateType => typeof(StorageComponentState);
protected bool _open;
/// <inheritdoc />
public override void ExposeData(ObjectSerializer serializer)
{
base.ExposeData(serializer);
serializer.DataField(ref _open, "open", false);
}
}
[Serializable, NetSerializable]
public class StorageComponentState : ComponentState
{
public bool Open { get; }
public StorageComponentState(bool open)
: base(ContentNetIDs.INVENTORY)
{
Open = open;
}
}
/// <summary>
@@ -92,4 +69,11 @@ namespace Content.Shared.GameObjects.Components.Storage
Directed = true;
}
}
[NetSerializable]
[Serializable]
public enum StorageVisuals
{
Open
}
}