Files
tbd-station-14/Content.Server/GameObjects/Components/Items/Storage/StorableComponent.cs
DrSmugleaf 1477cd4d0a Make component states dependant on the player getting them (#3280)
* Make component states dependant on the player getting them

Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>

* Updated submodule to v0.3.7.

Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
Co-authored-by: Acruid <shatter66@gmail.com>
2021-02-18 00:09:07 -08:00

49 lines
1.1 KiB
C#

using Content.Shared.GameObjects.Components.Storage;
using Robust.Shared.GameObjects;
using Robust.Shared.Players;
namespace Content.Server.GameObjects.Components.Items.Storage
{
[RegisterComponent]
[ComponentReference(typeof(SharedStorableComponent))]
public class StorableComponent : SharedStorableComponent
{
private int _size;
public override int Size
{
get => _size;
set
{
if (_size == value)
{
return;
}
_size = value;
Dirty();
}
}
public override ComponentState GetComponentState(ICommonSession player)
{
return new StorableComponentState(_size);
}
}
/// <summary>
/// Enum for the storage capacity of various containers
/// </summary>
public enum ReferenceSizes
{
Wallet = 4,
Pocket = 12,
Box = 24,
Belt = 30,
Toolbox = 60,
Backpack = 100,
NoStoring = 9999
}
}