This repository has been archived on 2023-02-02. You can view files and clone it, but cannot push or open issues or pull requests.
mfgames-gallium-cil/src/Gallium/WhereNotAllComponentExtensions.cs
2022-07-06 01:34:51 -05:00

45 lines
1.2 KiB
C#

using System.Collections.Generic;
using System.Linq;
namespace Gallium
{
public static class WhereNotAllComponentExtensions
{
public static IEnumerable<Entity> WhereNotComponent<T1>(
this IEnumerable<Entity> entities)
{
return entities.Where(x => !x.Has<T1>());
}
public static IEnumerable<Entity> WhereNotAllComponents<T1>(
this IEnumerable<Entity> entities)
{
return entities.Where(x => !x.Has<T1>());
}
public static IEnumerable<Entity> WhereNotAllComponents<T1, T2>(
this IEnumerable<Entity> entities)
{
return entities.Where(x => !x.HasAll<T1, T2>());
}
public static IEnumerable<Entity> WhereNotAllComponents<T1, T2, T3>(
this IEnumerable<Entity> entities)
{
return entities.Where(
x => !x.HasAll<T1, T2, T3>());
}
public static IEnumerable<Entity> WhereNotAllComponents<T1, T2, T3, T4>(
this IEnumerable<Entity> entities)
{
return entities.Where(
x => !x.Has<T1>()
|| !x.Has<T2>()
|| !x.Has<T3>()
|| !x.Has<T4>());
}
}
}