SolutionContainerManagerComponent.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  1. using Content.Shared.Chemistry.EntitySystems;
  2. using Robust.Shared.Containers;
  3. using Robust.Shared.GameStates;
  4. namespace Content.Shared.Chemistry.Components.SolutionManager;
  5. /// <summary>
  6. /// <para>A map of the solution entities contained within this entity.</para>
  7. /// <para>Every solution entity this maps should have a <see cref="SolutionComponent"/> to track its state and a <see cref="ContainedSolutionComponent"/> to track its container.</para>
  8. /// </summary>
  9. [RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
  10. [Access(typeof(SharedSolutionContainerSystem))]
  11. public sealed partial class SolutionContainerManagerComponent : Component
  12. {
  13. /// <summary>
  14. /// The default amount of space that will be allocated for solutions in solution containers.
  15. /// Most solution containers will only contain 1-2 solutions.
  16. /// </summary>
  17. public const int DefaultCapacity = 2;
  18. /// <summary>
  19. /// The names of each solution container attached to this entity.
  20. /// Actually accessing them must be done via <see cref="ContainerManagerComponent"/>.
  21. /// </summary>
  22. [DataField, AutoNetworkedField]
  23. public HashSet<string> Containers = new(DefaultCapacity);
  24. /// <summary>
  25. /// The set of solutions to load onto this entity during mapinit.
  26. /// </summary>
  27. /// <remarks>
  28. /// Should be null after mapinit.
  29. /// </remarks>
  30. [DataField, AutoNetworkedField]
  31. public Dictionary<string, Solution>? Solutions = null;
  32. }