2020-10-14 15:24:07 +02:00
|
|
|
|
using Content.Shared.GameObjects.Components.Storage;
|
|
|
|
|
|
using Robust.Shared.GameObjects;
|
2021-02-18 09:09:07 +01:00
|
|
|
|
using Robust.Shared.Players;
|
2018-04-22 06:11:38 -05:00
|
|
|
|
|
2020-07-03 23:57:19 +02:00
|
|
|
|
namespace Content.Server.GameObjects.Components.Items.Storage
|
2018-04-22 06:11:38 -05:00
|
|
|
|
{
|
2019-07-31 15:02:36 +02:00
|
|
|
|
[RegisterComponent]
|
2020-10-14 15:24:07 +02:00
|
|
|
|
[ComponentReference(typeof(SharedStorableComponent))]
|
|
|
|
|
|
public class StorableComponent : SharedStorableComponent
|
2018-04-22 06:11:38 -05:00
|
|
|
|
{
|
2020-10-14 15:24:07 +02:00
|
|
|
|
private int _size;
|
2018-04-22 06:11:38 -05:00
|
|
|
|
|
2020-10-14 15:24:07 +02:00
|
|
|
|
public override int Size
|
2018-04-22 06:11:38 -05:00
|
|
|
|
{
|
2020-10-14 15:24:07 +02:00
|
|
|
|
get => _size;
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
if (_size == value)
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
_size = value;
|
2018-04-22 06:11:38 -05:00
|
|
|
|
|
2020-10-14 15:24:07 +02:00
|
|
|
|
Dirty();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-02-18 09:09:07 +01:00
|
|
|
|
public override ComponentState GetComponentState(ICommonSession player)
|
2020-10-14 15:24:07 +02:00
|
|
|
|
{
|
|
|
|
|
|
return new StorableComponentState(_size);
|
2018-04-22 06:11:38 -05:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Enum for the storage capacity of various containers
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public enum ReferenceSizes
|
|
|
|
|
|
{
|
|
|
|
|
|
Wallet = 4,
|
|
|
|
|
|
Pocket = 12,
|
|
|
|
|
|
Box = 24,
|
2018-04-25 06:42:35 -05:00
|
|
|
|
Belt = 30,
|
2018-04-22 06:11:38 -05:00
|
|
|
|
Toolbox = 60,
|
|
|
|
|
|
Backpack = 100,
|
|
|
|
|
|
NoStoring = 9999
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|