1
0

SharedMapLayerData.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. using System.Collections.ObjectModel;
  2. using Content.Shared.Whitelist;
  3. using Robust.Shared.Serialization;
  4. namespace Content.Shared.Storage.Components
  5. {
  6. [Serializable, NetSerializable]
  7. public enum StorageMapVisuals : sbyte
  8. {
  9. InitLayers,
  10. LayerChanged,
  11. }
  12. [Serializable]
  13. [DataDefinition]
  14. public sealed partial class SharedMapLayerData
  15. {
  16. public string Layer = string.Empty;
  17. [DataField(required: true)]
  18. public EntityWhitelist? Whitelist { get; set; }
  19. /// <summary>
  20. /// Minimal amount of entities that are valid for whitelist.
  21. /// If it's smaller than minimal amount, layer will be hidden.
  22. /// </summary>
  23. [DataField]
  24. public int MinCount = 1;
  25. /// <summary>
  26. /// Max amount of entities that are valid for whitelist.
  27. /// If it's bigger than max amount, layer will be hidden.
  28. /// </summary>
  29. [DataField]
  30. public int MaxCount = int.MaxValue;
  31. }
  32. [Serializable, NetSerializable]
  33. public sealed class ShowLayerData : ICloneable
  34. {
  35. public readonly IReadOnlyList<string> QueuedEntities;
  36. public ShowLayerData()
  37. {
  38. QueuedEntities = new List<string>();
  39. }
  40. public ShowLayerData(IReadOnlyList<string> other)
  41. {
  42. QueuedEntities = other;
  43. }
  44. public object Clone()
  45. {
  46. // QueuedEntities should never be getting modified after this object is created.
  47. return this;
  48. }
  49. }
  50. }