MaterialPrototype.cs 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. using Robust.Shared.Prototypes;
  2. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Array;
  3. using Robust.Shared.Utility;
  4. namespace Content.Shared.Materials
  5. {
  6. /// <summary>
  7. /// Materials are read-only storage for the properties of specific materials.
  8. /// Properties should be intrinsic (or at least as much is necessary for game purposes).
  9. /// </summary>
  10. [Prototype]
  11. public sealed partial class MaterialPrototype : IPrototype, IInheritingPrototype
  12. {
  13. [ViewVariables]
  14. [ParentDataField(typeof(AbstractPrototypeIdArraySerializer<MaterialPrototype>))]
  15. public string[]? Parents { get; private set; }
  16. [ViewVariables]
  17. [AbstractDataField]
  18. public bool Abstract { get; private set; } = false;
  19. [ViewVariables]
  20. [IdDataField]
  21. public string ID { get; private set; } = default!;
  22. /// <summary>
  23. /// For material storage to be able to convert back and forth
  24. /// between the material and physical entities you can carry,
  25. /// include which stack we should spawn by default.
  26. /// </summary>
  27. [DataField]
  28. public EntProtoId? StackEntity;
  29. [DataField]
  30. public string Name = string.Empty;
  31. /// <summary>
  32. /// Locale id for the unit of this material.
  33. /// Lathe recipe tooltips and material storage display use this to let you change a material to sound nicer.
  34. /// For example, 5 bars of gold is better than 5 sheets of gold.
  35. /// </summary>
  36. [DataField]
  37. public LocId Unit = "materials-unit-sheet";
  38. [DataField]
  39. public Color Color { get; private set; } = Color.Gray;
  40. /// <summary>
  41. /// An icon used to represent the material in graphic interfaces.
  42. /// </summary>
  43. [DataField]
  44. public SpriteSpecifier Icon { get; private set; } = SpriteSpecifier.Invalid;
  45. /// <summary>
  46. /// The price per cm3.
  47. /// </summary>
  48. [DataField(required: true)]
  49. public double Price = 0;
  50. }
  51. }