1
0

TransformableContainerComponent.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. using Content.Server.Animals.Systems;
  2. using Content.Server.Chemistry.EntitySystems;
  3. using Content.Shared.Chemistry.Reagent;
  4. namespace Content.Server.Chemistry.Components;
  5. /// <summary>
  6. /// A container that transforms its appearance depending on the reagent it contains.
  7. /// It returns to its initial state once the reagent is removed.
  8. /// e.g. An empty glass changes to a beer glass when beer is added to it.
  9. ///
  10. /// Should probably be joined with SolutionContainerVisualsComponent when solutions are networked.
  11. /// </summary>
  12. [RegisterComponent, Access(typeof(TransformableContainerSystem))]
  13. public sealed partial class TransformableContainerComponent : Component
  14. {
  15. /// <summary>
  16. /// This is the initial metadata description for the container.
  17. /// It will revert to this when emptied.
  18. /// /// It defaults to the description of the parent entity unless overwritten.
  19. /// </summary>
  20. [DataField("initialDescription")]
  21. public string? InitialDescription;
  22. /// <summary>
  23. /// This stores whatever primary reagent is currently in the container.
  24. /// It is used to help determine if a transformation is needed on solution update.
  25. /// </summary>
  26. [DataField("currentReagent")]
  27. public ReagentPrototype? CurrentReagent;
  28. /// <summary>
  29. /// This returns whether this container in a transformed or initial state.
  30. /// </summary>
  31. ///
  32. [DataField("transformed")]
  33. public bool Transformed;
  34. }