Documentation

This commit is contained in:
Simon Lübeß
2023-12-13 14:45:33 +01:00
parent ed756f5847
commit a129156641
17 changed files with 211 additions and 37 deletions
+9
View File
@@ -3,8 +3,17 @@ using System.Linq;
namespace GlitchyEngine.Extensions;
/// <summary>
/// Extends the <see cref="IEnumerable{T}"/>-interface with useful methods.
/// </summary>
public static class EnumExtension
{
/// <summary>
/// Enumerates the enumerable and returns a tuple containing the item and the index for every item.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="self"></param>
/// <returns></returns>
public static IEnumerable<(T item, int index)> WithIndex<T>(this IEnumerable<T> self)
=> self.Select((item, index) => (item, index));
}