Minor spill refactors (#5569)

This commit is contained in:
Ygg01
2021-12-05 04:18:30 +01:00
committed by GitHub
parent 5d63411113
commit d1ab9592aa
12 changed files with 248 additions and 253 deletions

View File

@@ -1,5 +1,7 @@
using System.Diagnostics.CodeAnalysis;
using System.Text;
using Content.Server.Chemistry.Components.SolutionManager;
using Content.Server.Database;
using Content.Shared.Chemistry.Components;
using Content.Shared.Chemistry.Reagent;
using Content.Shared.FixedPoint;
@@ -128,5 +130,27 @@ namespace Content.Server.Chemistry.EntitySystems
return true;
}
public static string ToPrettyString(Solution solution)
{
var sb = new StringBuilder();
sb.Append("Solution content: [");
var first = true;
foreach (var (id, quantity) in solution.Contents)
{
if (first)
{
first = false;
}
else
{
sb.Append(", ");
}
sb.AppendFormat("{0}: {1}u", id, quantity);
}
sb.Append(']');
return sb.ToString();
}
}
}