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

◆ ShuffleCombination()

void ShuffleCombination ( string combinationText,
bool isInsideLock = false )
protected

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

478 {
479 string shuffledText;
480
481 //insert zeros to dials with 0 value
482 int lengthDiff = m_LockDigits - combinationText.Length();
483 for (int i = 0; i < lengthDiff; ++i)
484 {
485 combinationText = "0" + combinationText;
486 }
487
488 //assemble the whole combination with increased part
489 for (int j = 0; j < combinationText.Length(); ++j)
490 {
491 int dialNumber = combinationText.Get(j).ToInt();
492 dialNumber = ( dialNumber + Math.RandomInt( 1, 9 ) ) % 10;
493 shuffledText = shuffledText + dialNumber.ToString();
494 if (!isInsideLock)
496 else
498 }
499
500 if (!isInsideLock)
501 SetCombination(shuffledText.ToInt());
502 else
503 SetCombinationInside(shuffledText.ToInt());
504 }
int m_LockDigits
Определения CombinationLock.c:32
void SetCombination(int combination, bool setOtherSide=true)
Определения CombinationLock.c:233
void SetCombinationInside(int combination, bool setOtherSide=true)
Определения CombinationLock.c:242
static float GetDigitRotation(int digitValue)
Определения CombinationLock.c:689
void SetDigitRotationAnimationPhaseOutside(string digitIndex, float rot)
Определения CombinationLock.c:718
void SetDigitRotationAnimationPhaseInside(string digitIndex, float rot)
Определения CombinationLock.c:724
proto string ToString()
Определения EnMath.c:7
static proto int RandomInt(int min, int max)
Returns a random int number between and min [inclusive] and max [exclusive].
proto native int Length()
Returns length of string.
proto string Get(int index)
Gets n-th character from string.
static proto string ToString(void var, bool type=false, bool name=false, bool quotes=true)
Return string representation of variable.
proto native int ToInt()
Converts string to integer.

Перекрестные ссылки string::Get(), GetDigitRotation(), string::Length(), m_LockDigits, Math::RandomInt(), SetCombination(), SetCombinationInside(), SetDigitRotationAnimationPhaseInside(), SetDigitRotationAnimationPhaseOutside(), string::ToInt(), string::ToString() и ToString().

Используется в ShuffleLock().