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

◆ SetQuantityNormalized()

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

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

3381 {
3382 float value_clamped = Math.Clamp(value, 0, 1);//just to make sure
3383 int result = Math.Round(Math.Lerp(GetQuantityMin(), GetQuantityMax(), value_clamped));
3384 SetQuantity(result, destroy_config, destroy_forced);
3385 }
override int GetQuantityMax()
Определения ItemBase.c:3408
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:3308
override int GetQuantityMin()
Определения ItemBase.c:3440

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