Revert "Solution Entities" (#23160)

Revert "Solution Entities (#21916)"

This reverts commit d75e743dd7.
This commit is contained in:
Emisse
2023-12-28 20:45:42 -07:00
committed by GitHub
parent c2c76c2035
commit 938d6d9945
180 changed files with 2959 additions and 3543 deletions

View File

@@ -1,31 +0,0 @@
using Content.Shared.Chemistry.EntitySystems;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
namespace Content.Shared.Chemistry.Components.SolutionManager;
/// <summary>
/// Component used to relate a solution to its container.
/// </summary>
/// <remarks>
/// When containers are finally ECS'd have this attach to the container entity.
/// The <see cref="Solution.MaxVolume"/> field should then be extracted out into this component.
/// Solution entities would just become an apporpriately composed entity hanging out in the container.
/// Will probably require entities in components being given a relation to associate themselves with their container.
/// </remarks>
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
[Access(typeof(SharedSolutionContainerSystem))]
public sealed partial class ContainedSolutionComponent : Component
{
/// <summary>
/// The entity that the solution is contained in.
/// </summary>
[DataField(required: true), AutoNetworkedField]
public EntityUid Container;
/// <summary>
/// The name/key of the container the solution is located in.
/// </summary>
[DataField(required: true), AutoNetworkedField]
public string ContainerName = default!;
}

View File

@@ -9,6 +9,7 @@ public sealed partial class DrawableSolutionComponent : Component
/// <summary>
/// Solution name that can be removed with syringes.
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)]
public string Solution = "default";
[ViewVariables(VVAccess.ReadWrite)]
[DataField("solution")]
public string Solution { get; set; } = "default";
}

View File

@@ -3,6 +3,7 @@
[RegisterComponent]
public sealed partial class ExaminableSolutionComponent : Component
{
[DataField, ViewVariables(VVAccess.ReadWrite)]
public string Solution = "default";
[ViewVariables(VVAccess.ReadWrite)]
[DataField("solution")]
public string Solution { get; set; } = "default";
}

View File

@@ -10,6 +10,7 @@ public sealed partial class InjectableSolutionComponent : Component
/// <summary>
/// Solution name which can be added with syringes.
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)]
public string Solution = "default";
[ViewVariables(VVAccess.ReadWrite)]
[DataField("solution")]
public string Solution { get; set; } = "default";
}

View File

@@ -1,36 +1,12 @@
using Content.Shared.Chemistry.EntitySystems;
using Robust.Shared.Containers;
using Robust.Shared.GameStates;
namespace Content.Shared.Chemistry.Components.SolutionManager;
/// <summary>
/// <para>A map of the solution entities contained within 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))]
[RegisterComponent]
[Access(typeof(SolutionContainerSystem))]
public sealed partial class SolutionContainerManagerComponent : Component
{
/// <summary>
/// The default amount of space that will be allocated for solutions in solution containers.
/// Most solution containers will only contain 1-2 solutions.
/// </summary>
public const int DefaultCapacity = 2;
/// <summary>
/// The names of each solution container attached to this entity.
/// Actually accessing them must be done via <see cref="ContainerManagerComponent"/>.
/// </summary>
[DataField, AutoNetworkedField]
public HashSet<string> Containers = new(DefaultCapacity);
/// <summary>
/// The set of solutions to load onto this entity during mapinit.
/// </summary>
/// <remarks>
/// Should be null after mapinit.
/// </remarks>
[DataField(serverOnly: true)] // Needs to be serverOnly or these will get loaded on the client and never cleared. Can be reworked when entity spawning is predicted.
public Dictionary<string, Solution>? Solutions = null;
[DataField("solutions")]
[Access(typeof(SolutionContainerSystem), Other = AccessPermissions.ReadExecute)] // FIXME Friends
public Dictionary<string, Solution> Solutions = new();
}