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

namespace MonoGame.FourEngine.Extensions
{
    public static class EnumerableExt
    {
        public static IEnumerable<T> Filter<T>(this IEnumerable enumerable)
        {
            foreach (var item in enumerable)
            {
                if (item is T filteredItem) yield return filteredItem;
            }
        }
    }
}