GasMixtureStringRepresentation.cs 522 B

12345678910111213141516
  1. namespace Content.Shared.Atmos;
  2. public readonly record struct GasMixtureStringRepresentation(float TotalMoles, float Temperature, float Pressure, Dictionary<string, float> MolesPerGas) : IFormattable
  3. {
  4. public override string ToString()
  5. {
  6. return $"{Temperature}K {Pressure} kPa";
  7. }
  8. public string ToString(string? format, IFormatProvider? formatProvider)
  9. {
  10. return ToString();
  11. }
  12. public static implicit operator string(GasMixtureStringRepresentation rep) => rep.ToString();
  13. }