1
0

MachineBoardComponent.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using Content.Shared.Stacks;
  2. using Content.Shared.Tag;
  3. using Robust.Shared.GameStates;
  4. using Robust.Shared.Prototypes;
  5. namespace Content.Shared.Construction.Components;
  6. [RegisterComponent, NetworkedComponent]
  7. public sealed partial class MachineBoardComponent : Component
  8. {
  9. /// <summary>
  10. /// The stacks needed to construct this machine
  11. /// </summary>
  12. [DataField]
  13. public Dictionary<ProtoId<StackPrototype>, int> StackRequirements = new();
  14. /// <summary>
  15. /// Entities needed to construct this machine, discriminated by tag.
  16. /// </summary>
  17. [DataField]
  18. public Dictionary<ProtoId<TagPrototype>, GenericPartInfo> TagRequirements = new();
  19. /// <summary>
  20. /// Entities needed to construct this machine, discriminated by component.
  21. /// </summary>
  22. [DataField]
  23. public Dictionary<string, GenericPartInfo> ComponentRequirements = new();
  24. /// <summary>
  25. /// The machine that's constructed when this machine board is completed.
  26. /// </summary>
  27. [DataField(required: true)]
  28. public EntProtoId Prototype;
  29. }
  30. [DataDefinition, Serializable]
  31. public partial struct GenericPartInfo
  32. {
  33. [DataField(required: true)]
  34. public int Amount;
  35. [DataField(required: true)]
  36. public EntProtoId DefaultPrototype;
  37. [DataField]
  38. public LocId? ExamineName;
  39. }