diff options
| author | RblSb <msrblsb@gmail.com> | 2020-02-24 01:19:30 +0300 |
|---|---|---|
| committer | RblSb <msrblsb@gmail.com> | 2020-02-24 01:19:30 +0300 |
| commit | c561fb9e2e42e4968f2b48cd535f208e90f8c12c (patch) | |
| tree | 0c7e1ffc99744aabbb240864b371b9555a611d92 /src/server/Utils.hx | |
| parent | 113b06e895f5dc752e8393c2a4f3f1669a7d0aab (diff) | |
More playlist and video control
Diffstat (limited to 'src/server/Utils.hx')
| -rw-r--r-- | src/server/Utils.hx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/server/Utils.hx b/src/server/Utils.hx index c3510c9..2ecbd42 100644 --- a/src/server/Utils.hx +++ b/src/server/Utils.hx @@ -27,4 +27,15 @@ class Utils { } return "127.0.0.1"; } + + public static function shuffle<T>(arr:Array<T>):Void { + for (i in 0...arr.length) { + final n = Std.random(arr.length); + final a = arr[i]; + final b = arr[n]; + arr[i] = b; + arr[n] = a; + } + } + } |
