From dcf1b00241c3cd245c2687b325c840930ce734d3 Mon Sep 17 00:00:00 2001 From: Chomp Date: Tue, 14 Jan 2025 20:20:19 +0000 Subject: [PATCH] Implemented GetArrayValue --- Core/Utils/RandomUtil.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Core/Utils/RandomUtil.cs b/Core/Utils/RandomUtil.cs index 2549c1b1..9b6d0294 100644 --- a/Core/Utils/RandomUtil.cs +++ b/Core/Utils/RandomUtil.cs @@ -440,4 +440,10 @@ public List Shuffle(List originalList) ? parts[1].Length : 0; } + + public T GetArrayValue(IEnumerable list) + { + var rand = new Random(); + return list.ElementAt(rand.Next(0, list.Count())); + } }