mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 13:01:52 +00:00
Documentation
This commit is contained in:
@@ -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));
|
||||
}
|
||||
Reference in New Issue
Block a user