DamageGroupPrototype.cs 1.1 KB

1234567891011121314151617181920212223242526272829
  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 Group of <see cref="DamageTypePrototype"/>s.
  8. /// </summary>
  9. /// <remarks>
  10. /// These groups can be used to specify supported damage types of a <see cref="DamageContainerPrototype"/>, or
  11. /// to change/get/set damage in a <see cref="DamageableComponent"/>.
  12. /// </remarks>
  13. [Prototype(2)]
  14. [Serializable, NetSerializable]
  15. public sealed partial class DamageGroupPrototype : IPrototype
  16. {
  17. [IdDataField] public string ID { get; private set; } = default!;
  18. [DataField(required: true)]
  19. private LocId Name { get; set; }
  20. [ViewVariables(VVAccess.ReadOnly)]
  21. public string LocalizedName => Loc.GetString(Name);
  22. [DataField("damageTypes", required: true, customTypeSerializer: typeof(PrototypeIdListSerializer<DamageTypePrototype>))]
  23. public List<string> DamageTypes { get; private set; } = default!;
  24. }
  25. }