using System;
using System.Collections.Generic;
using System.Linq;

namespace StoryEngine.Core.Extensions
{
    internal static class IEnumerableExt
    {
        public static IEnumerable<T1> InnerJoin<T1, T2>(this IEnumerable<T1> input, IEnumerable<T2> filter, Func<T1, T2, bool> mapping)
            => input.Where(i => filter.Any(f => mapping(i, f)));
    }
}