Merge remote-tracking branch 'origin/feature/fight_system' into feature/showcase_kathi

This commit is contained in:
2025-07-11 03:13:08 +02:00
42 changed files with 3664 additions and 20 deletions
+27
View File
@@ -0,0 +1,27 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data.SqlTypes;
using System.Linq;
using System.Xml.Schema;
namespace Babushka.scripts.CSharp.Common.Util;
public static class LinqExtras
{
public static void ForEach<T>(this IEnumerable<T> self, Action<T> action)
{
foreach (var t in self)
{
action.Invoke(t);
}
}
public static T? Random<T>(this IEnumerable<T> self)
{
var selfList = self.ToList();
if (selfList.Count == 0) return default;
if (selfList.Count == 1) return selfList[0];
var randomIndex = new Random().Next(0, selfList.Count);
return selfList[randomIndex];
}
}
@@ -0,0 +1 @@
uid://clcirtaf47g5p