Table of Contents

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

bool

Methods

FormatCelsiusTemperature(float, int)

Formats a Celsius temperature with the game's Celsius unit display.

public static string FormatCelsiusTemperature(float celsius, int decimalPoints)

Parameters

celsius float

The temperature in degrees Celsius.

decimalPoints int

The 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

fahrenheit float

The temperature in degrees Fahrenheit.

decimalPoints int

The 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

celsius float

The temperature in degrees Celsius.

decimalPoints int

The 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

celsius float

The temperature in degrees Celsius.

Returns

float

The normalized temperature.

ToFahrenheit(float)

Converts a Celsius temperature to Fahrenheit.

public static float ToFahrenheit(float celsius)

Parameters

celsius float

The temperature in degrees Celsius.

Returns

float

The temperature in degrees Fahrenheit.