PhysicalCompositionComponent.cs 1.3 KB

12345678910111213141516171819202122232425262728293031
  1. using Content.Shared.Chemistry.Reagent;
  2. using Content.Shared.FixedPoint;
  3. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Dictionary;
  4. namespace Content.Shared.Materials;
  5. /// <summary>
  6. /// This is used for assigning an innate material/chemical composition to an entity.
  7. /// These aren't materials per se, but rather the materials which "make up" an entity.
  8. /// This also isn't something that should exist simultaneously with <see cref="MaterialComponent"/>.
  9. /// </summary>
  10. /// <remarks>
  11. /// The reason for duel material/chemical is for the eventual
  12. /// combination of the two systems.
  13. /// </remarks>
  14. [RegisterComponent]
  15. public sealed partial class PhysicalCompositionComponent : Component
  16. {
  17. /// <summary>
  18. /// The materials that "make up" this entity
  19. /// </summary>
  20. [DataField("materialComposition", customTypeSerializer: typeof(PrototypeIdDictionarySerializer<int, MaterialPrototype>))]
  21. public Dictionary<string, int> MaterialComposition = new();
  22. /// <summary>
  23. /// The chemicals that "make up" this entity
  24. /// </summary>
  25. [DataField("chemicalComposition", customTypeSerializer: typeof(PrototypeIdDictionarySerializer<FixedPoint2, ReagentPrototype>))]
  26. public Dictionary<string, FixedPoint2> ChemicalComposition = new();
  27. // TODO use ReagentQuantity[]
  28. }