Class TemperatureUtility
- Namespace
- S1API.Temperature
- Assembly
- S1API.dll
Formats and converts temperatures with the game's native temperature helpers.
public static class TemperatureUtility
- Inheritance
-
TemperatureUtility
- Inherited Members
Properties
TemperatureSystemEnabled
Gets whether the game's temperature system is currently enabled.
public static bool TemperatureSystemEnabled { get; }
Property Value
Methods
FormatCelsiusTemperature(float, int)
Formats a Celsius temperature with the game's Celsius unit display.
public static string FormatCelsiusTemperature(float celsius, int decimalPoints)
Parameters
celsiusfloatThe temperature in degrees Celsius.
decimalPointsintThe number of decimal places to display.
Returns
- string
The formatted Celsius temperature.
FormatFahrenheitTemperature(float, int)
Formats a Fahrenheit temperature with the game's Fahrenheit unit display.
public static string FormatFahrenheitTemperature(float fahrenheit, int decimalPoints)
Parameters
fahrenheitfloatThe temperature in degrees Fahrenheit.
decimalPointsintThe number of decimal places to display.
Returns
- string
The formatted Fahrenheit temperature.
FormatTemperatureWithAppropriateUnit(float, int)
Formats a Celsius temperature with the unit selected by the game.
public static string FormatTemperatureWithAppropriateUnit(float celsius, int decimalPoints = 1)
Parameters
celsiusfloatThe temperature in degrees Celsius.
decimalPointsintThe number of decimal places to display.
Returns
- string
The formatted temperature.
NormalizeTemperature(float)
Normalizes a Celsius temperature with the game's native temperature range.
public static float NormalizeTemperature(float celsius)
Parameters
celsiusfloatThe temperature in degrees Celsius.
Returns
- float
The normalized temperature.
ToFahrenheit(float)
Converts a Celsius temperature to Fahrenheit.
public static float ToFahrenheit(float celsius)
Parameters
celsiusfloatThe temperature in degrees Celsius.
Returns
- float
The temperature in degrees Fahrenheit.