Archived
Private
Public Access
1
0

Update 07.12.2022

This commit is contained in:
2022-12-07 15:35:41 +01:00
parent 771f58073f
commit 840d7ad42f
288 changed files with 148948 additions and 4346 deletions

View File

@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
namespace TaxiJob.Shared {
public static class ArrayExtensions {
public static T Random<T>(this IEnumerable<T> enumerable, [Optional] int seed) {
var random = new Random(seed != 0 ? seed : Environment.TickCount);
var array = enumerable.ToArray();
var index = random.Next(array.Length);
return array[index];
}
}
}