Complete builders, start work on using them
This commit is contained in:
22
src/Discord.Net.Commands/Extensions/IEnumerableExtensions.cs
Normal file
22
src/Discord.Net.Commands/Extensions/IEnumerableExtensions.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Discord.Commands
|
||||
{
|
||||
public static class IEnumerableExtensions
|
||||
{
|
||||
public static IEnumerable<TResult> Permutate<TFirst, TSecond, TResult>(
|
||||
this IEnumerable<TFirst> set,
|
||||
IEnumerable<TSecond> others,
|
||||
Func<TFirst, TSecond, TResult> func)
|
||||
{
|
||||
foreach (TFirst elem in set)
|
||||
{
|
||||
foreach (TSecond elem2 in others)
|
||||
{
|
||||
yield return func(elem, elem2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user