mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-09-29 23:57:29 +00:00
* atmos masked flammability/API * on that oomba pac * yuuup * resolve todo and review * rename
26 lines
801 B
C#
26 lines
801 B
C#
using System.Text;
|
|
|
|
namespace Content.Shared.Atmos;
|
|
|
|
public readonly record struct GasMixtureStringRepresentation(float TotalMoles, float Temperature, float Pressure, Dictionary<string, float> MolesPerGas) : IFormattable
|
|
{
|
|
public override string ToString()
|
|
{
|
|
var stringBuilder = new StringBuilder();
|
|
foreach (var (gas, moles) in MolesPerGas)
|
|
{
|
|
stringBuilder.Append($"{gas}: {moles}, ");
|
|
}
|
|
var result = stringBuilder.ToString();
|
|
|
|
return $"{Temperature} K, {Pressure} kPa, {result}Total Moles: {TotalMoles}";
|
|
}
|
|
|
|
public string ToString(string? format, IFormatProvider? formatProvider)
|
|
{
|
|
return ToString();
|
|
}
|
|
|
|
public static implicit operator string(GasMixtureStringRepresentation rep) => rep.ToString();
|
|
}
|