mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-10-02 09:07:27 +00:00
* Port EvenlySplitting for Cryotubes * Make Trinox consistent * Bring into DV_Systems * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
24 lines
807 B
C#
24 lines
807 B
C#
using Content.Shared.Chemistry.Components;
|
|
using Content.Shared.FixedPoint;
|
|
|
|
namespace Content.Shared.Chemistry.EntitySystems;
|
|
|
|
public abstract partial class SharedSolutionContainerSystem
|
|
{
|
|
/// <summary>
|
|
/// Splits a solution removing a specified amount of each reagent, if available.
|
|
/// </summary>
|
|
/// <param name="soln">The container to split the solution from.</param>
|
|
/// <param name="quantity">The amount of each reagent to split.</param>
|
|
/// <returns></returns>
|
|
public Solution SplitSolutionReagentsEvenly(Entity<SolutionComponent> soln, FixedPoint2 quantity)
|
|
{
|
|
var (uid, comp) = soln;
|
|
var solution = comp.Solution;
|
|
|
|
var splitSol = solution.SplitSolutionReagentsEvenly(quantity);
|
|
UpdateChemicals(soln);
|
|
return splitSol;
|
|
}
|
|
}
|