LatheRecipePrototype.cs 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. using Content.Shared.Chemistry.Reagent;
  2. using Content.Shared.FixedPoint;
  3. using Content.Shared.Lathe.Prototypes;
  4. using Content.Shared.Materials;
  5. using Robust.Shared.Prototypes;
  6. using Robust.Shared.Serialization;
  7. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Array;
  8. using Robust.Shared.Utility;
  9. namespace Content.Shared.Research.Prototypes
  10. {
  11. [NetSerializable, Serializable, Prototype]
  12. public sealed partial class LatheRecipePrototype : IPrototype, IInheritingPrototype
  13. {
  14. [ViewVariables]
  15. [IdDataField]
  16. public string ID { get; private set; } = default!;
  17. /// <inheritdoc/>
  18. [ParentDataField(typeof(AbstractPrototypeIdArraySerializer<LatheRecipePrototype>))]
  19. public string[]? Parents { get; private set; }
  20. /// <inheritdoc />
  21. [NeverPushInheritance]
  22. [AbstractDataField]
  23. public bool Abstract { get; private set; }
  24. /// <summary>
  25. /// Name displayed in the lathe GUI.
  26. /// </summary>
  27. [DataField]
  28. public LocId? Name;
  29. /// <summary>
  30. /// Short description displayed in the lathe GUI.
  31. /// </summary>
  32. [DataField]
  33. public LocId? Description;
  34. /// <summary>
  35. /// The prototype name of the resulting entity when the recipe is printed.
  36. /// </summary>
  37. [DataField]
  38. public EntProtoId? Result;
  39. [DataField]
  40. public Dictionary<ProtoId<ReagentPrototype>, FixedPoint2>? ResultReagents;
  41. /// <summary>
  42. /// An entity whose sprite is displayed in the ui in place of the actual recipe result.
  43. /// </summary>
  44. [DataField]
  45. public SpriteSpecifier? Icon;
  46. [DataField("completetime")]
  47. public TimeSpan CompleteTime = TimeSpan.FromSeconds(5);
  48. /// <summary>
  49. /// The materials required to produce this recipe.
  50. /// Takes a material ID as string.
  51. /// </summary>
  52. [DataField]
  53. public Dictionary<ProtoId<MaterialPrototype>, int> Materials = new();
  54. [DataField]
  55. public bool ApplyMaterialDiscount = true;
  56. /// <summary>
  57. /// List of categories used for visually sorting lathe recipes in the UI.
  58. /// </summary>
  59. [DataField]
  60. public List<ProtoId<LatheCategoryPrototype>> Categories = new();
  61. }
  62. }