* Shuffle the elements */
| 320 | * Shuffle the elements |
| 321 | */ |
| 322 | FORCEINLINE void Shuffle() |
| 323 | { |
| 324 | int32 LastIndex = Num() - 1; |
| 325 | for (int32 i = 0; i <= LastIndex; ++i) |
| 326 | { |
| 327 | int32 Index = FMath::RandRange(i, LastIndex); |
| 328 | if (i != Index) |
| 329 | { |
| 330 | ScriptArray->SwapMemory(i, Index, ElementSize); |
| 331 | } |
| 332 | } |
| 333 | } |
| 334 | |
| 335 | /** |
| 336 | * Append another array |