Revert unnecessary changes made by previous PR to SolutionCompon… (#583)

#574 added an out arg to `SolutionComponent.TryRemoveSolution` containing the solution that was removed. I made this change since I thought there was no way to get the removed solution for further use. Didn't notice `SplitSolution` which provides nearly the same behavior. With this PR I want to remove that out arg from `TryRemoveSolution` to keep the SolutionComponent API simple and to avoid having multiple ways of doing things. Existing code uses `SplitSolution`, I just wasn't paying attention.

Feel free to deny merging this if I'm over thinking it. I think it'll help keep solution code from becoming a mess.
This commit is contained in:
moneyl
2020-02-06 10:13:32 -05:00
committed by GitHub
parent 184f2fb68d
commit 6a1d2124df
4 changed files with 9 additions and 32 deletions

View File

@@ -127,16 +127,13 @@ namespace Content.Shared.GameObjects.Components.Chemistry
/// Attempt to remove the specified quantity from this solution
/// </summary>
/// <param name="quantity">Quantity of this solution to remove</param>
/// <param name="removedSolution">Out arg. The removed solution. Useful for adding removed solution
/// into other solutions. For example, when pouring from one container to another.</param>
/// <returns>Whether or not the solution was successfully removed</returns>
public bool TryRemoveSolution(int quantity, out Solution removedSolution)
public bool TryRemoveSolution(int quantity)
{
removedSolution = new Solution();
if (CurrentVolume == 0)
return false;
_containedSolution.RemoveSolution(quantity, out removedSolution);
_containedSolution.RemoveSolution(quantity);
OnSolutionChanged();
return true;
}