CatStation/Content.Shared/Chemistry/Components/SolutionManager/SolutionManagerComponent.cs
Princess Cheeseballs 1bcb6499b4
Fix some prediction and solution duplication issues with the solutions refactor. (#43728)
* fix prediction and solution duplication issues

* lock down

* wait I fogrot other systems need to read this id I'm stupid

* fix

* actually throw

* better comment and obsoletion

* master merge + fix popup text

* netowkring fix

* better debug assert

* back to basics

* dumbb

---------

Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
2026-05-02 15:56:31 +00:00

37 lines
1.6 KiB
C#

using Content.Shared.Chemistry.EntitySystems;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
namespace Content.Shared.Chemistry.Components.SolutionManager;
/// <summary>
/// <para>Allows for an entity to have and manage multiple solutions.</para>
/// <para>Spawns additional solutions from their prototypes, and stores them in a container.</para>
/// <para>Also used in the case another component spawns a solution for this entity.</para>
/// <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>
/// </summary>
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
[Access(typeof(SharedSolutionContainerSystem))]
public sealed partial class SolutionManagerComponent : Component
{
public static readonly string DefaultContainerId = "solutions";
/// <summary>
/// The names of the container for solutions attached to this entity.
/// </summary>
[DataField, AutoNetworkedField]
public string Container = DefaultContainerId;
/// <summary>
/// A cache of solutions currently attached to this entity.
/// </summary>
[ViewVariables]
[Access(typeof(SharedSolutionContainerSystem), Other = AccessPermissions.None)]
public Dictionary<string, Entity<SolutionComponent>> Solutions = new ();
/// <summary>
/// A list of solution entities to spawn during <see cref="MapInitEvent"/>.
/// </summary>
[DataField("solutions", readOnly: true)]
public EntProtoId[]? SolutionEnts;
}