MechAssemblyComponent.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using Content.Shared.Storage.Components;
  2. using Content.Shared.Tag;
  3. using Content.Shared.Tools;
  4. using Robust.Shared.Containers;
  5. using Robust.Shared.Prototypes;
  6. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
  7. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Dictionary;
  8. namespace Content.Server.Mech.Components;
  9. /// <summary>
  10. /// A component used to create a mech chassis
  11. /// after the correct parts have been placed inside
  12. /// of it.
  13. /// </summary>
  14. /// <remarks>
  15. /// The actual visualization of the parts being inserted is
  16. /// done via <see cref="ItemMapperComponent"/>
  17. /// </remarks>
  18. [RegisterComponent]
  19. public sealed partial class MechAssemblyComponent : Component
  20. {
  21. /// <summary>
  22. /// The parts needed to be placed within the assembly,
  23. /// stored as a tag and a bool tracking whether or not
  24. /// they're present.
  25. /// </summary>
  26. [DataField("requiredParts", required: true, customTypeSerializer: typeof(PrototypeIdDictionarySerializer<bool, TagPrototype>))]
  27. public Dictionary<string, bool> RequiredParts = new();
  28. /// <summary>
  29. /// The prototype spawned when the assembly is finished
  30. /// </summary>
  31. [DataField("finishedPrototype", required: true, customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
  32. public string FinishedPrototype = default!;
  33. /// <summary>
  34. /// The container that stores all of the parts when
  35. /// they're being assembled.
  36. /// </summary>
  37. [ViewVariables]
  38. public Container PartsContainer = default!;
  39. /// <summary>
  40. /// The quality of tool needed to remove all the parts
  41. /// from the parts container.
  42. /// </summary>
  43. [DataField("qualityNeeded", customTypeSerializer: typeof(PrototypeIdSerializer<ToolQualityPrototype>))]
  44. public string QualityNeeded = "Prying";
  45. }