DamageContainerPrototype.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536
  1. using Robust.Shared.Prototypes;
  2. using Robust.Shared.Serialization;
  3. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
  4. namespace Content.Shared.Damage.Prototypes
  5. {
  6. /// <summary>
  7. /// A damage container which can be used to specify support for various damage types.
  8. /// </summary>
  9. /// <remarks>
  10. /// This is effectively just a list of damage types that can be specified in YAML files using both damage types
  11. /// and damage groups. Currently this is only used to specify what damage types a <see
  12. /// cref="DamageableComponent"/> should support.
  13. /// </remarks>
  14. [Prototype]
  15. [Serializable, NetSerializable]
  16. public sealed partial class DamageContainerPrototype : IPrototype
  17. {
  18. [ViewVariables]
  19. [IdDataField]
  20. public string ID { get; private set; } = default!;
  21. /// <summary>
  22. /// List of damage groups that are supported by this container.
  23. /// </summary>
  24. [DataField("supportedGroups", customTypeSerializer: typeof(PrototypeIdListSerializer<DamageGroupPrototype>))]
  25. public List<string> SupportedGroups = new();
  26. /// <summary>
  27. /// Partial List of damage types supported by this container. Note that members of the damage groups listed
  28. /// in <see cref="SupportedGroups"/> are also supported, but they are not included in this list.
  29. /// </summary>
  30. [DataField("supportedTypes", customTypeSerializer: typeof(PrototypeIdListSerializer<DamageTypePrototype>))]
  31. public List<string> SupportedTypes = new();
  32. }
  33. }