DayZ 1.27
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 строка 542

543 {
544 if ( Count() > 0 )
545 {
546 return Math.RandomInt(0, Count());
547 }
548
549 return -1;
550 }
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto native int Count()

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

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