mirror of
https://github.com/unity-atoms/unity-atoms.git
synced 2025-01-21 23:58:49 -05:00
Added every to ListExtensions
This commit is contained in:
parent
e976823647
commit
4b10374850
@ -137,7 +137,17 @@ namespace UnityAtoms.Extensions
|
||||
|
||||
public static bool Some<T>(this List<T> list, Func<T, bool> func)
|
||||
{
|
||||
return EqualityComparer<T>.Default.Equals(list.First(func), default(T));
|
||||
return !EqualityComparer<T>.Default.Equals(list.First(func), default(T));
|
||||
}
|
||||
|
||||
public static bool Every<T>(this List<T> list, Func<T, bool> func)
|
||||
{
|
||||
for (int i = 0; list != null && i < list.Count; ++i)
|
||||
{
|
||||
if (!func(list[i])) return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static bool AddIfNotExists<T>(this List<T> list, T item)
|
||||
|
@ -20,4 +20,4 @@ namespace UnityAtoms.Extensions
|
||||
return v2 + (distance.normalized * maxDistance);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user