2019-04-15 21:11:38 -06:00
|
|
|
|
using Robust.Shared.GameObjects;
|
|
|
|
|
|
using Robust.Shared.Serialization;
|
2018-04-22 06:11:38 -05:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Content.Shared.GameObjects.Components.Storage
|
|
|
|
|
|
{
|
|
|
|
|
|
public abstract class SharedStorageComponent : Component
|
|
|
|
|
|
{
|
2019-04-17 23:26:00 +02:00
|
|
|
|
public override string Name => "Storage";
|
2018-04-25 06:42:35 -05:00
|
|
|
|
public override uint? NetID => ContentNetIDs.INVENTORY;
|
2018-04-22 06:11:38 -05:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Updates the client component about what entities this storage is holding
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[Serializable, NetSerializable]
|
|
|
|
|
|
public class StorageHeldItemsMessage : ComponentMessage
|
|
|
|
|
|
{
|
|
|
|
|
|
public readonly int StorageSizeMax;
|
|
|
|
|
|
public readonly int StorageSizeUsed;
|
|
|
|
|
|
public Dictionary<EntityUid, int> StoredEntities;
|
|
|
|
|
|
|
|
|
|
|
|
public StorageHeldItemsMessage(Dictionary<EntityUid, int> storedentities, int storageused, int storagemaxsize)
|
|
|
|
|
|
{
|
|
|
|
|
|
Directed = true;
|
|
|
|
|
|
StorageSizeMax = storagemaxsize;
|
|
|
|
|
|
StorageSizeUsed = storageused;
|
|
|
|
|
|
StoredEntities = storedentities;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Component message for removing a contained entity from the storage entity
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[Serializable, NetSerializable]
|
|
|
|
|
|
public class RemoveEntityMessage : ComponentMessage
|
|
|
|
|
|
{
|
|
|
|
|
|
public EntityUid EntityUid;
|
|
|
|
|
|
|
|
|
|
|
|
public RemoveEntityMessage(EntityUid entityuid)
|
|
|
|
|
|
{
|
|
|
|
|
|
Directed = true;
|
|
|
|
|
|
EntityUid = entityuid;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Component message for opening the storage UI
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[Serializable, NetSerializable]
|
|
|
|
|
|
public class OpenStorageUIMessage : ComponentMessage
|
|
|
|
|
|
{
|
|
|
|
|
|
public OpenStorageUIMessage()
|
|
|
|
|
|
{
|
|
|
|
|
|
Directed = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2018-06-20 16:49:13 -04:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Component message for closing the storage UI.
|
|
|
|
|
|
/// E.g when the player moves too far away from the container.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[Serializable, NetSerializable]
|
|
|
|
|
|
public class CloseStorageUIMessage : ComponentMessage
|
|
|
|
|
|
{
|
|
|
|
|
|
public CloseStorageUIMessage()
|
|
|
|
|
|
{
|
|
|
|
|
|
Directed = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2019-05-05 18:52:06 +02:00
|
|
|
|
|
|
|
|
|
|
[NetSerializable]
|
|
|
|
|
|
[Serializable]
|
|
|
|
|
|
public enum StorageVisuals
|
|
|
|
|
|
{
|
|
|
|
|
|
Open
|
|
|
|
|
|
}
|
2018-04-22 06:11:38 -05:00
|
|
|
|
}
|