CloningSettingsPrototype.cs 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. using Content.Shared.Inventory;
  2. using Content.Shared.Whitelist;
  3. using Robust.Shared.Prototypes;
  4. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Array;
  5. namespace Content.Shared.Cloning;
  6. /// <summary>
  7. /// Settings for cloning a humanoid.
  8. /// Used to decide which components should be copied.
  9. /// </summary>
  10. [Prototype]
  11. public sealed partial class CloningSettingsPrototype : IPrototype, IInheritingPrototype
  12. {
  13. /// <inheritdoc/>
  14. [IdDataField]
  15. public string ID { get; private set; } = default!;
  16. [ParentDataField(typeof(PrototypeIdArraySerializer<CloningSettingsPrototype>))]
  17. public string[]? Parents { get; }
  18. [AbstractDataField]
  19. [NeverPushInheritance]
  20. public bool Abstract { get; }
  21. /// <summary>
  22. /// Determines if cloning can be prevented by traits etc.
  23. /// </summary>
  24. [DataField]
  25. public bool ForceCloning = true;
  26. /// <summary>
  27. /// Which inventory slots will receive a copy of the original's clothing.
  28. /// Disabled when null.
  29. /// </summary>
  30. [DataField]
  31. public SlotFlags? CopyEquipment = SlotFlags.All;
  32. /// <summary>
  33. /// Whether or not to copy slime storage and storage implant contents.
  34. /// </summary>
  35. [DataField]
  36. public bool CopyInternalStorage = true;
  37. /// <summary>
  38. /// Whether or not to copy implants.
  39. /// </summary>
  40. [DataField]
  41. public bool CopyImplants = true;
  42. /// <summary>
  43. /// Whitelist for the equipment allowed to be copied.
  44. /// </summary>
  45. [DataField]
  46. public EntityWhitelist? Whitelist;
  47. /// <summary>
  48. /// Blacklist for the equipment allowed to be copied.
  49. /// </summary>
  50. [DataField]
  51. public EntityWhitelist? Blacklist;
  52. /// TODO: Make this not a string https://github.com/space-wizards/RobustToolbox/issues/5709
  53. /// <summary>
  54. /// Components to copy from the original to the clone.
  55. /// This only makes a shallow copy of datafields!
  56. /// If you need a deep copy or additional component initialization, then subscribe to CloningEvent instead!
  57. /// </summary>
  58. [DataField]
  59. [AlwaysPushInheritance]
  60. public HashSet<string> Components = new();
  61. }