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

◆ ShuffleLock()

void ShuffleLock ( )
protected

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

343 {
344 string combination_text = m_Combination.ToString();
345 string shuffled_text;
346
347 //insert zeros to dials with 0 value
348 int length_diff = m_LockDigits - combination_text.Length();
349 for ( int i = 0; i < length_diff; ++i )
350 {
351 combination_text = "0" + combination_text;
352 }
353
354 //assemble the whole combination with increased part
355 for ( int j = 0; j < combination_text.Length(); ++j )
356 {
357 int dial_number = combination_text.Get( j ).ToInt();
358 dial_number = ( dial_number + Math.RandomInt( 1, 9 ) ) % 10;
359 shuffled_text = shuffled_text + dial_number.ToString();
360 }
361
362 SetCombination( shuffled_text.ToInt() );
363 }
enum LockAction m_LockDigits
void SetCombination(int combination)
Определения CombinationLock.c:181
int m_Combination
Определения CombinationLock.c:15
Определения 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.
proto native int ToInt()
Converts string to integer.

Перекрестные ссылки string::Get(), string::Length(), m_Combination, m_LockDigits, Math::RandomInt(), SetCombination() и string::ToInt().

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