Table of Contents

Class Climate

Namespace
Vintagestory.API.Common
Assembly
VintagestoryAPI.dll
public class Climate
Inheritance
Climate
Inherited Members
Extension Methods

Fields

Sealevel

This value is update once the config is loaded and the Sealevel is known

public static int Sealevel

Field Value

int

TemperatureScaleConversion

Temperature conversion factor used to get real temperatures from the climate's temperature int Used to convert from real temperature range float [-50 , 40] to int [0 , 255]

public static float TemperatureScaleConversion

Field Value

float

Methods

DescaleTemperature(float)

Convert from real temperature range float [-50 , 40] to int [0 , 255]

public static int DescaleTemperature(float temperature)

Parameters

temperature float

Returns

int

GetAdjustedTemperature(int, int)

Convert from int [0 , 255] range to real temperature range int [-20 , 40] The distToSealevel/1.5f is also hardcoded in shaderincluds/colormap.vsh

public static int GetAdjustedTemperature(int unscaledTemp, int distToSealevel)

Parameters

unscaledTemp int
distToSealevel int

Returns

int

GetFertility(int, float, float)

public static int GetFertility(int rain, float scaledTemp, float posYRel)

Parameters

rain int
scaledTemp float
posYRel float

Returns

int

GetFertilityFromUnscaledTemp(int, int, float)

public static int GetFertilityFromUnscaledTemp(int rain, int unscaledTemp, float posYRel)

Parameters

rain int
unscaledTemp int
posYRel float

Returns

int

GetRainFall(int, int)

public static int GetRainFall(int rainfall, int y)

Parameters

rainfall int
y int

Returns

int

GetScaledAdjustedTemperature(int, int)

Convert from int [0 , 255] range to real temperature range float [-20 , 40] The distToSealevel/1.5f is also hardcoded in shaderincluds/colormap.vsh

public static int GetScaledAdjustedTemperature(int unscaledTemp, int distToSealevel)

Parameters

unscaledTemp int
distToSealevel int

Returns

int

GetScaledAdjustedTemperatureFloat(int, int)

Convert from int [0 , 255] range to real temperature range float [-20 , 40] The distToSealevel/1.5f is also hardcoded in shaderincluds/colormap.vsh

public static float GetScaledAdjustedTemperatureFloat(int unscaledTemp, int distToSealevel)

Parameters

unscaledTemp int
distToSealevel int

Returns

float

GetScaledAdjustedTemperatureFloatClient(int, int)

Convert from int [0 , 255] range to real temperature range float [-50 , 40] The distToSealevel/1.5f is also hardcoded in shaderincluds/colormap.vsh

This exists since the client had a different value for min

public static float GetScaledAdjustedTemperatureFloatClient(int unscaledTemp, int distToSealevel)

Parameters

unscaledTemp int
distToSealevel int

Returns

float