Revert "Solution Entities" (#23160)
Revert "Solution Entities (#21916)"
This reverts commit d75e743dd7.
This commit is contained in:
@@ -71,7 +71,6 @@ namespace Content.Shared.Chemistry.Components
|
||||
/// <summary>
|
||||
/// The name of this solution, if it is contained in some <see cref="SolutionContainerManagerComponent"/>
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public string? Name;
|
||||
|
||||
/// <summary>
|
||||
@@ -101,7 +100,7 @@ namespace Content.Shared.Chemistry.Components
|
||||
foreach (var (reagent, quantity) in Contents)
|
||||
{
|
||||
_heatCapacity += (float) quantity *
|
||||
protoMan.Index<ReagentPrototype>(reagent.Prototype).SpecificHeat;
|
||||
protoMan.Index<ReagentPrototype>(reagent.Prototype).SpecificHeat;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,12 +158,10 @@ namespace Content.Shared.Chemistry.Components
|
||||
|
||||
public Solution(Solution solution)
|
||||
{
|
||||
Contents = solution.Contents.ShallowClone();
|
||||
Volume = solution.Volume;
|
||||
MaxVolume = solution.MaxVolume;
|
||||
Temperature = solution.Temperature;
|
||||
_heatCapacity = solution._heatCapacity;
|
||||
_heatCapacityDirty = solution._heatCapacityDirty;
|
||||
Contents = solution.Contents.ShallowClone();
|
||||
ValidateSolution();
|
||||
}
|
||||
|
||||
@@ -177,7 +174,7 @@ namespace Content.Shared.Chemistry.Components
|
||||
public void ValidateSolution()
|
||||
{
|
||||
// sandbox forbids: [Conditional("DEBUG")]
|
||||
#if DEBUG
|
||||
#if DEBUG
|
||||
// Correct volume
|
||||
DebugTools.Assert(Contents.Select(x => x.Quantity).Sum() == Volume);
|
||||
|
||||
@@ -195,7 +192,7 @@ namespace Content.Shared.Chemistry.Components
|
||||
UpdateHeatCapacity(null);
|
||||
DebugTools.Assert(MathHelper.CloseTo(_heatCapacity, cur));
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void ISerializationHooks.AfterDeserialization()
|
||||
|
||||
Reference in New Issue
Block a user