DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ SetQuantityNormalized()

override void SetQuantityNormalized ( float value,
bool destroy_config = true,
bool destroy_forced = false )
protected

Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config(for Min 0 and Max 5000, setting 0.5 will result in value 2500)

См. определение в файле ItemBase.c строка 3407

3408 {
3409 float value_clamped = Math.Clamp(value, 0, 1);//just to make sure
3410 int result = Math.Round(Math.Lerp(GetQuantityMin(), GetQuantityMax(), value_clamped));
3411 SetQuantity(result, destroy_config, destroy_forced);
3412 }
override void SetQuantity()
Определения ConstructionInfoIcons.c:298
override int GetQuantityMin()
Определения ItemBase.c:3470
override int GetQuantityMax()
Определения ItemBase.c:3435
Определения EnMath.c:7
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.
static proto float Round(float f)
Returns mathematical round of value.
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.

Перекрестные ссылки Math::Clamp(), GetQuantityMax(), GetQuantityMin(), Math::Lerp(), Math::Round() и SetQuantity().

Используется в FlammableBase::CalculateQuantity(), ConvertEnergyToQuantity() и SetCEBasedQuantity().