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

◆ SetQuantityNormalized()

void InventoryItem::SetQuantityNormalized ( float value,
bool destroy_config = true,
bool destroy_forced = false )
inlineprivate

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 строка 3310

3311 {
3312 float value_clamped = Math.Clamp(value, 0, 1);//just to make sure
3313 int result = Math.Round(Math.Lerp(GetQuantityMin(), GetQuantityMax(), value_clamped));
3314 SetQuantity(result, destroy_config, destroy_forced);
3315 }
override int GetQuantityMax()
Определения ItemBase.c:3338
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
Set item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
Определения ItemBase.c:3238
override int GetQuantityMin()
Определения ItemBase.c:3370

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