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

◆ GetRandomIndex()

int array< Class T >::GetRandomIndex ( )
inlineprivate

Returns a random index of array. If Count is 0, return index is -1 .

Возвращает
int Random index of array
Print( my_array.GetRandomIndex() );
>> 2
proto void Print(void var)
Prints content of variable to console/log.

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

567 {
568 if ( Count() > 0 )
569 {
570 return Math.RandomInt(0, Count());
571 }
572
573 return -1;
574 }
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto native int Count()

Перекрестные ссылки Count и Math::RandomInt().

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