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

◆ CalculateVisibleBars()

int CalculateVisibleBars ( float batteryPercent)
protected

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

500 {
501 if (!m_CodeLock.HasValidParent())
502 return 0;
503
504 if (batteryPercent <= 0)
505 return 0;
506
507 const int maxBars = 6;
508 float barsFloat = Math.Ceil((batteryPercent / 100.0) * maxBars);
509 return Math.Max(0, Math.Min(maxBars, barsFloat));
510 }
enum CodeLockLightState m_CodeLock
Определения EnMath.c:7
static proto float Max(float x, float y)
Returns bigger of two given values.
static proto float Min(float x, float y)
Returns smaller of two given values.
static proto float Ceil(float f)
Returns ceil of value.

Перекрестные ссылки Math::Ceil(), m_CodeLock, Math::Max() и Math::Min().

Используется в HasBatteryLevelChanged() и UpdateBatteryIndicator().