2023-05-15 14:22:17 +12:00
|
|
|
using System.Collections.ObjectModel;
|
2021-07-22 11:56:55 +02:00
|
|
|
using Content.Shared.Whitelist;
|
|
|
|
|
using Robust.Shared.Serialization;
|
|
|
|
|
|
2021-09-04 19:42:32 +02:00
|
|
|
namespace Content.Shared.Storage.Components
|
2021-07-22 11:56:55 +02:00
|
|
|
{
|
|
|
|
|
[Serializable, NetSerializable]
|
|
|
|
|
public enum StorageMapVisuals : sbyte
|
|
|
|
|
{
|
|
|
|
|
InitLayers,
|
|
|
|
|
LayerChanged,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Serializable]
|
|
|
|
|
[DataDefinition]
|
2023-08-22 18:14:33 -07:00
|
|
|
public sealed partial class SharedMapLayerData
|
2021-07-22 11:56:55 +02:00
|
|
|
{
|
|
|
|
|
public string Layer = string.Empty;
|
|
|
|
|
|
2024-06-26 23:03:06 +03:00
|
|
|
[DataField("whitelist", required: true)]
|
|
|
|
|
public EntityWhitelist? ServerWhitelist { get; set; }
|
2022-04-12 02:21:15 +03:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Minimal amount of entities that are valid for whitelist.
|
|
|
|
|
/// If it's smaller than minimal amount, layer will be hidden.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataField("minCount")]
|
|
|
|
|
public int MinCount = 1;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Max amount of entities that are valid for whitelist.
|
|
|
|
|
/// If it's bigger than max amount, layer will be hidden.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataField("maxCount")]
|
|
|
|
|
public int MaxCount = int.MaxValue;
|
2021-07-22 11:56:55 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Serializable, NetSerializable]
|
2022-02-16 00:23:23 -07:00
|
|
|
public sealed class ShowLayerData : ICloneable
|
2021-07-22 11:56:55 +02:00
|
|
|
{
|
2023-05-15 14:22:17 +12:00
|
|
|
public readonly IReadOnlyList<string> QueuedEntities;
|
2021-07-22 11:56:55 +02:00
|
|
|
|
|
|
|
|
public ShowLayerData()
|
|
|
|
|
{
|
|
|
|
|
QueuedEntities = new List<string>();
|
|
|
|
|
}
|
|
|
|
|
|
2023-05-15 14:22:17 +12:00
|
|
|
public ShowLayerData(IReadOnlyList<string> other)
|
2021-07-22 11:56:55 +02:00
|
|
|
{
|
2023-05-15 14:22:17 +12:00
|
|
|
QueuedEntities = other;
|
2021-07-22 11:56:55 +02:00
|
|
|
}
|
|
|
|
|
|
2022-01-31 05:34:48 +13:00
|
|
|
public object Clone()
|
2021-07-22 11:56:55 +02:00
|
|
|
{
|
2023-05-15 14:22:17 +12:00
|
|
|
// QueuedEntities should never be getting modified after this object is created.
|
|
|
|
|
return this;
|
2021-07-22 11:56:55 +02:00
|
|
|
}
|
|
|
|
|
}
|
2021-09-04 19:42:32 +02:00
|
|
|
}
|