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

◆ DialNextNumber()

void DialNextNumber ( )
protected

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

203 {
204 string combination_text = m_Combination.ToString();
205 string dialed_text;
206
207 //insert zeros to dials with 0 value
208 int length_diff = m_LockDigits - combination_text.Length();
209 for ( int i = 0; i < length_diff; ++i )
210 {
211 combination_text = "0" + combination_text;
212 }
213
214 //assemble the whole combination with increased part
215 for ( int j = 0; j < combination_text.Length(); ++j )
216 {
217 if ( j == m_DialIndex )
218 {
219 int next_dialed_number = combination_text.Get( j ).ToInt() + 1;
220 if ( next_dialed_number > 9 )
221 {
222 next_dialed_number = 0;
223 }
224
225 dialed_text += next_dialed_number.ToString();
226 }
227 else
228 {
229 dialed_text += combination_text.Get( j );
230 }
231 }
232
233 //set new number
234 SetCombination( dialed_text.ToInt() );
235 m_LockActionPerformed = LockAction.DIAL_INDEX_CHANGED;
237
238 //synchronize
239 Synchronize();
240 }
enum LockAction m_LockDigits
void CheckLockedStateServer()
Определения CombinationLock.c:370
void SetCombination(int combination)
Определения CombinationLock.c:181
LockAction
Определения CombinationLock.c:2
void Synchronize()
Определения CombinationLock.c:151
int m_Combination
Определения CombinationLock.c:15
int m_DialIndex
Определения CombinationLock.c:17
LockAction m_LockActionPerformed
Определения CombinationLock.c:20
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.

Перекрестные ссылки CheckLockedStateServer(), string::Get(), string::Length(), m_Combination, m_DialIndex, m_LockActionPerformed, m_LockDigits, SetCombination(), Synchronize() и string::ToInt().