using System; using Unity.Collections.LowLevel.Unsafe; //------------------------------------------------------------------------------ // // This code was generated by a tool. // // t4 Packages/com.unity.collections/Unity.Collections/NativeParallelHashSetExtensions.tt // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // //------------------------------------------------------------------------------ namespace Unity.Collections { /// /// Provides extension methods for sets. /// public unsafe static class HashSetExtensions { /// /// Removes the values from this set which are also present in another collection. /// /// The type of values. /// The set to remove values from. /// The collection to compare with. public static void ExceptWith(this ref NativeHashSet container, FixedList128Bytes other) where T : unmanaged, IEquatable { foreach (var item in other) { container.Remove(item); } } /// /// Removes the values from this set which are absent in another collection. /// /// The type of values. /// The set to remove values from. /// The collection to compare with. public static void IntersectWith(this ref NativeHashSet container, FixedList128Bytes other) where T : unmanaged, IEquatable { var result = new UnsafeList(container.Count, Allocator.Temp); foreach (var item in other) { if (container.Contains(item)) { result.Add(item); } } container.Clear(); container.UnionWith(result); result.Dispose(); } /// /// Adds all distinct values from the other collection to this set. /// Does not throw if a value is already in this set. /// /// The type of values. /// The set to add values to. /// The collection to copy values from. public static void UnionWith(this ref NativeHashSet container, FixedList128Bytes other) where T : unmanaged, IEquatable { foreach (var item in other) { container.TryAdd(item); } } /// /// Removes the values from this set which are also present in another collection. /// /// The type of values. /// The set to remove values from. /// The collection to compare with. public static void ExceptWith(this ref NativeHashSet container, FixedList32Bytes other) where T : unmanaged, IEquatable { foreach (var item in other) { container.Remove(item); } } /// /// Removes the values from this set which are absent in another collection. /// /// The type of values. /// The set to remove values from. /// The collection to compare with. public static void IntersectWith(this ref NativeHashSet container, FixedList32Bytes other) where T : unmanaged, IEquatable { var result = new UnsafeList(container.Count, Allocator.Temp); foreach (var item in other) { if (container.Contains(item)) { result.Add(item); } } container.Clear(); container.UnionWith(result); result.Dispose(); } /// /// Adds all distinct values from the other collection to this set. /// Does not throw if a value is already in this set. /// /// The type of values. /// The set to add values to. /// The collection to copy values from. public static void UnionWith(this ref NativeHashSet container, FixedList32Bytes other) where T : unmanaged, IEquatable { foreach (var item in other) { container.TryAdd(item); } } /// /// Removes the values from this set which are also present in another collection. /// /// The type of values. /// The set to remove values from. /// The collection to compare with. public static void ExceptWith(this ref NativeHashSet container, FixedList4096Bytes other) where T : unmanaged, IEquatable { foreach (var item in other) { container.Remove(item); } } /// /// Removes the values from this set which are absent in another collection. /// /// The type of values. /// The set to remove values from. /// The collection to compare with. public static void IntersectWith(this ref NativeHashSet container, FixedList4096Bytes other) where T : unmanaged, IEquatable { var result = new UnsafeList(container.Count, Allocator.Temp); foreach (var item in other) { if (container.Contains(item)) { result.Add(item); } } container.Clear(); container.UnionWith(result); result.Dispose(); } /// /// Adds all distinct values from the other collection to this set. /// Does not throw if a value is already in this set. /// /// The type of values. /// The set to add values to. /// The collection to copy values from. public static void UnionWith(this ref NativeHashSet container, FixedList4096Bytes other) where T : unmanaged, IEquatable { foreach (var item in other) { container.TryAdd(item); } } /// /// Removes the values from this set which are also present in another collection. /// /// The type of values. /// The set to remove values from. /// The collection to compare with. public static void ExceptWith(this ref NativeHashSet container, FixedList512Bytes other) where T : unmanaged, IEquatable { foreach (var item in other) { container.Remove(item); } } /// /// Removes the values from this set which are absent in another collection. /// /// The type of values. /// The set to remove values from. /// The collection to compare with. public static void IntersectWith(this ref NativeHashSet container, FixedList512Bytes other) where T : unmanaged, IEquatable { var result = new UnsafeList(container.Count, Allocator.Temp); foreach (var item in other) { if (container.Contains(item)) { result.Add(item); } } container.Clear(); container.UnionWith(result); result.Dispose(); } /// /// Adds all distinct values from the other collection to this set. /// Does not throw if a value is already in this set. /// /// The type of values. /// The set to add values to. /// The collection to copy values from. public static void UnionWith(this ref NativeHashSet container, FixedList512Bytes other) where T : unmanaged, IEquatable { foreach (var item in other) { container.TryAdd(item); } } /// /// Removes the values from this set which are also present in another collection. /// /// The type of values. /// The set to remove values from. /// The collection to compare with. public static void ExceptWith(this ref NativeHashSet container, FixedList64Bytes other) where T : unmanaged, IEquatable { foreach (var item in other) { container.Remove(item); } } /// /// Removes the values from this set which are absent in another collection. /// /// The type of values. /// The set to remove values from. /// The collection to compare with. public static void IntersectWith(this ref NativeHashSet container, FixedList64Bytes other) where T : unmanaged, IEquatable { var result = new UnsafeList(container.Count, Allocator.Temp); foreach (var item in other) { if (container.Contains(item)) { result.Add(item); } } container.Clear(); container.UnionWith(result); result.Dispose(); } /// /// Adds all distinct values from the other collection to this set. /// Does not throw if a value is already in this set. /// /// The type of values. /// The set to add values to. /// The collection to copy values from. public static void UnionWith(this ref NativeHashSet container, FixedList64Bytes other) where T : unmanaged, IEquatable { foreach (var item in other) { container.TryAdd(item); } } /// /// Removes the values from this set which are also present in another collection. /// /// The type of values. /// The set to remove values from. /// The collection to compare with. public static void ExceptWith(this ref NativeHashSet container, NativeArray other) where T : unmanaged, IEquatable { foreach (var item in other) { container.Remove(item); } } /// /// Removes the values from this set which are absent in another collection. /// /// The type of values. /// The set to remove values from. /// The collection to compare with. public static void IntersectWith(this ref NativeHashSet container, NativeArray other) where T : unmanaged, IEquatable { var result = new UnsafeList(container.Count, Allocator.Temp); foreach (var item in other) { if (container.Contains(item)) { result.Add(item); } } container.Clear(); container.UnionWith(result); result.Dispose(); } /// /// Adds all distinct values from the other collection to this set. /// Does not throw if a value is already in this set. /// /// The type of values. /// The set to add values to. /// The collection to copy values from. public static void UnionWith(this ref NativeHashSet container, NativeArray other) where T : unmanaged, IEquatable { foreach (var item in other) { container.TryAdd(item); } } /// /// Removes the values from this set which are also present in another collection. /// /// The type of values. /// The set to remove values from. /// The collection to compare with. public static void ExceptWith(this ref NativeHashSet container, NativeHashSet other) where T : unmanaged, IEquatable { foreach (var item in other) { container.Remove(item); } } /// /// Removes the values from this set which are absent in another collection. /// /// The type of values. /// The set to remove values from. /// The collection to compare with. public static void IntersectWith(this ref NativeHashSet container, NativeHashSet other) where T : unmanaged, IEquatable { var result = new UnsafeList(container.Count, Allocator.Temp); foreach (var item in other) { if (container.Contains(item)) { result.Add(item); } } container.Clear(); container.UnionWith(result); result.Dispose(); } /// /// Adds all distinct values from the other collection to this set. /// Does not throw if a value is already in this set. /// /// The type of values. /// The set to add values to. /// The collection to copy values from. public static void UnionWith(this ref NativeHashSet container, NativeHashSet other) where T : unmanaged, IEquatable { foreach (var item in other) { container.TryAdd(item); } } /// /// Removes the values from this set which are also present in another collection. /// /// The type of values. /// The set to remove values from. /// The collection to compare with. public static void ExceptWith(this ref NativeHashSet container, NativeHashSet.ReadOnly other) where T : unmanaged, IEquatable { foreach (var item in other) { container.Remove(item); } } /// /// Removes the values from this set which are absent in another collection. /// /// The type of values. /// The set to remove values from. /// The collection to compare with. public static void IntersectWith(this ref NativeHashSet container, NativeHashSet.ReadOnly other) where T : unmanaged, IEquatable { var result = new UnsafeList(container.Count, Allocator.Temp); foreach (var item in other) { if (container.Contains(item)) { result.Add(item); } } container.Clear(); container.UnionWith(result); result.Dispose(); } /// /// Adds all distinct values from the other collection to this set. /// Does not throw if a value is already in this set. /// /// The type of values. /// The set to add values to. /// The collection to copy values from. public static void UnionWith(this ref NativeHashSet container, NativeHashSet.ReadOnly other) where T : unmanaged, IEquatable { foreach (var item in other) { container.TryAdd(item); } } /// /// Removes the values from this set which are also present in another collection. /// /// The type of values. /// The set to remove values from. /// The collection to compare with. public static void ExceptWith(this ref NativeHashSet container, NativeParallelHashSet other) where T : unmanaged, IEquatable { foreach (var item in other) { container.Remove(item); } } /// /// Removes the values from this set which are absent in another collection. /// /// The type of values. /// The set to remove values from. /// The collection to compare with. public static void IntersectWith(this ref NativeHashSet container, NativeParallelHashSet other) where T : unmanaged, IEquatable { var result = new UnsafeList(container.Count, Allocator.Temp); foreach (var item in other) { if (container.Contains(item)) { result.Add(item); } } container.Clear(); container.UnionWith(result); result.Dispose(); } /// /// Adds all distinct values from the other collection to this set. /// Does not throw if a value is already in this set. /// /// The type of values. /// The set to add values to. /// The collection to copy values from. public static void UnionWith(this ref NativeHashSet container, NativeParallelHashSet other) where T : unmanaged, IEquatable { foreach (var item in other) { container.TryAdd(item); } } /// /// Removes the values from this set which are also present in another collection. /// /// The type of values. /// The set to remove values from. /// The collection to compare with. public static void ExceptWith(this ref NativeHashSet container, NativeParallelHashSet.ReadOnly other) where T : unmanaged, IEquatable { foreach (var item in other) { container.Remove(item); } } /// /// Removes the values from this set which are absent in another collection. /// /// The type of values. /// The set to remove values from. /// The collection to compare with. public static void IntersectWith(this ref NativeHashSet container, NativeParallelHashSet.ReadOnly other) where T : unmanaged, IEquatable { var result = new UnsafeList(container.Count, Allocator.Temp); foreach (var item in other) { if (container.Contains(item)) { result.Add(item); } } container.Clear(); container.UnionWith(result); result.Dispose(); } /// /// Adds all distinct values from the other collection to this set. /// Does not throw if a value is already in this set. /// /// The type of values. /// The set to add values to. /// The collection to copy values from. public static void UnionWith(this ref NativeHashSet container, NativeParallelHashSet.ReadOnly other) where T : unmanaged, IEquatable { foreach (var item in other) { container.TryAdd(item); } } /// /// Removes the values from this set which are also present in another collection. /// /// The type of values. /// The set to remove values from. /// The collection to compare with. public static void ExceptWith(this ref NativeHashSet container, NativeList other) where T : unmanaged, IEquatable { foreach (var item in other) { container.Remove(item); } } /// /// Removes the values from this set which are absent in another collection. /// /// The type of values. /// The set to remove values from. /// The collection to compare with. public static void IntersectWith(this ref NativeHashSet container, NativeList other) where T : unmanaged, IEquatable { var result = new UnsafeList(container.Count, Allocator.Temp); foreach (var item in other) { if (container.Contains(item)) { result.Add(item); } } container.Clear(); container.UnionWith(result); result.Dispose(); } /// /// Adds all distinct values from the other collection to this set. /// Does not throw if a value is already in this set. /// /// The type of values. /// The set to add values to. /// The collection to copy values from. public static void UnionWith(this ref NativeHashSet container, NativeList other) where T : unmanaged, IEquatable { foreach (var item in other) { container.TryAdd(item); } } /// /// Removes the values from this set which are also present in another collection. /// /// The type of values. /// The set to remove values from. /// The collection to compare with. public static void ExceptWith(this ref NativeParallelHashSet container, FixedList128Bytes other) where T : unmanaged, IEquatable { foreach (var item in other) { container.Remove(item); } } /// /// Removes the values from this set which are absent in another collection. /// /// The type of values. /// The set to remove values from. /// The collection to compare with. public static void IntersectWith(this ref NativeParallelHashSet container, FixedList128Bytes other) where T : unmanaged, IEquatable { var result = new UnsafeList(container.Count(), Allocator.Temp); foreach (var item in other) { if (container.Contains(item)) { result.Add(item); } } container.Clear(); container.UnionWith(result); result.Dispose(); } /// /// Adds all distinct values from the other collection to this set. /// Does not throw if a value is already in this set. /// /// The type of values. /// The set to add values to. /// The collection to copy values from. public static void UnionWith(this ref NativeParallelHashSet container, FixedList128Bytes other) where T : unmanaged, IEquatable { foreach (var item in other) { container.TryAdd(item); } } /// /// Removes the values from this set which are also present in another collection. /// /// The type of values. /// The set to remove values from. /// The collection to compare with. public static void ExceptWith(this ref NativeParallelHashSet container, FixedList32Bytes other) where T : unmanaged, IEquatable { foreach (var item in other) { container.Remove(item); } } /// /// Removes the values from this set which are absent in another collection. /// /// The type of values. /// The set to remove values from. /// The collection to compare with. public static void IntersectWith(this ref NativeParallelHashSet container, FixedList32Bytes other) where T : unmanaged, IEquatable { var result = new UnsafeList(container.Count(), Allocator.Temp); foreach (var item in other) { if (container.Contains(item)) { result.Add(item); } } container.Clear(); container.UnionWith(result); result.Dispose(); } /// /// Adds all distinct values from the other collection to this set. /// Does not throw if a value is already in this set. /// /// The type of values. /// The set to add values to. /// The collection to copy values from. public static void UnionWith(this ref NativeParallelHashSet container, FixedList32Bytes other) where T : unmanaged, IEquatable { foreach (var item in other) { container.TryAdd(item); } } /// /// Removes the values from this set which are also present in another collection. /// /// The type of values. /// The set to remove values from. /// The collection to compare with. public static void ExceptWith(this ref NativeParallelHashSet container, FixedList4096Bytes other) where T : unmanaged, IEquatable { foreach (var item in other) { container.Remove(item); } } /// /// Removes the values from this set which are absent in another collection. /// /// The type of values. /// The set to remove values from. /// The collection to compare with. public static void IntersectWith(this ref NativeParallelHashSet container, FixedList4096Bytes other) where T : unmanaged, IEquatable { var result = new UnsafeList(container.Count(), Allocator.Temp); foreach (var item in other) { if (container.Contains(item)) { result.Add(item); } } container.Clear(); container.UnionWith(result); result.Dispose(); } /// /// Adds all distinct values from the other collection to this set. /// Does not throw if a value is already in this set. /// /// The type of values. /// The set to add values to. /// The collection to copy values from. public static void UnionWith(this ref NativeParallelHashSet container, FixedList4096Bytes other) where T : unmanaged, IEquatable { foreach (var item in other) { container.TryAdd(item); } } /// /// Removes the values from this set which are also present in another collection. /// /// The type of values. /// The set to remove values from. /// The collection to compare with. public static void ExceptWith(this ref NativeParallelHashSet container, FixedList512Bytes other) where T : unmanaged, IEquatable { foreach (var item in other) { container.Remove(item); } } /// /// Removes the values from this set which are absent in another collection. /// /// The type of values. /// The set to remove values from. /// The collection to compare with. public static void IntersectWith(this ref NativeParallelHashSet container, FixedList512Bytes other) where T : unmanaged, IEquatable { var result = new UnsafeList(container.Count(), Allocator.Temp); foreach (var item in other) { if (container.Contains(item)) { result.Add(item); } } container.Clear(); container.UnionWith(result); result.Dispose(); } /// /// Adds all distinct values from the other collection to this set. /// Does not throw if a value is already in this set. /// /// The type of values. /// The set to add values to. /// The collection to copy values from. public static void UnionWith(this ref NativeParallelHashSet container, FixedList512Bytes other) where T : unmanaged, IEquatable { foreach (var item in other) { container.TryAdd(item); } } /// /// Removes the values from this set which are also present in another collection. /// /// The type of values. /// The set to remove values from. /// The collection to compare with. public static void ExceptWith(this ref NativeParallelHashSet container, FixedList64Bytes other) where T : unmanaged, IEquatable { foreach (var item in other) { container.Remove(item); } } /// /// Removes the values from this set which are absent in another collection. /// /// The type of values. /// The set to remove values from. /// The collection to compare with. public static void IntersectWith(this ref NativeParallelHashSet container, FixedList64Bytes other) where T : unmanaged, IEquatable { var result = new UnsafeList(container.Count(), Allocator.Temp); foreach (var item in other) { if (container.Contains(item)) { result.Add(item); } } container.Clear(); container.UnionWith(result); result.Dispose(); } /// /// Adds all distinct values from the other collection to this set. /// Does not throw if a value is already in this set. /// /// The type of values. /// The set to add values to. /// The collection to copy values from. public static void UnionWith(this ref NativeParallelHashSet container, FixedList64Bytes other) where T : unmanaged, IEquatable { foreach (var item in other) { container.TryAdd(item); } } /// /// Removes the values from this set which are also present in another collection. /// /// The type of values. /// The set to remove values from. /// The collection to compare with. public static void ExceptWith(this ref NativeParallelHashSet container, NativeArray other) where T : unmanaged, IEquatable { foreach (var item in other) { container.Remove(item); } } /// /// Removes the values from this set which are absent in another collection. /// /// The type of values. /// The set to remove values from. /// The collection to compare with. public static void IntersectWith(this ref NativeParallelHashSet container, NativeArray other) where T : unmanaged, IEquatable { var result = new UnsafeList(container.Count(), Allocator.Temp); foreach (var item in other) { if (container.Contains(item)) { result.Add(item); } } container.Clear(); container.UnionWith(result); result.Dispose(); } /// /// Adds all distinct values from the other collection to this set. /// Does not throw if a value is already in this set. /// /// The type of values. /// The set to add values to. /// The collection to copy values from. public static void UnionWith(this ref NativeParallelHashSet container, NativeArray other) where T : unmanaged, IEquatable { foreach (var item in other) { container.TryAdd(item); } } /// /// Removes the values from this set which are also present in another collection. /// /// The type of values. /// The set to remove values from. /// The collection to compare with. public static void ExceptWith(this ref NativeParallelHashSet container, NativeHashSet other) where T : unmanaged, IEquatable { foreach (var item in other) { container.Remove(item); } } /// /// Removes the values from this set which are absent in another collection. /// /// The type of values. /// The set to remove values from. /// The collection to compare with. public static void IntersectWith(this ref NativeParallelHashSet container, NativeHashSet other) where T : unmanaged, IEquatable { var result = new UnsafeList(container.Count(), Allocator.Temp); foreach (var item in other) { if (container.Contains(item)) { result.Add(item); } } container.Clear(); container.UnionWith(result); result.Dispose(); } /// /// Adds all distinct values from the other collection to this set. /// Does not throw if a value is already in this set. /// /// The type of values. /// The set to add values to. /// The collection to copy values from. public static void UnionWith(this ref NativeParallelHashSet container, NativeHashSet other) where T : unmanaged, IEquatable { foreach (var item in other) { container.TryAdd(item); } } /// /// Removes the values from this set which are also present in another collection. /// /// The type of values. /// The set to remove values from. /// The collection to compare with. public static void ExceptWith(this ref NativeParallelHashSet container, NativeHashSet.ReadOnly other) where T : unmanaged, IEquatable { foreach (var item in other) { container.Remove(item); } } /// /// Removes the values from this set which are absent in another collection. /// /// The type of values. /// The set to remove values from. /// The collection to compare with. public static void IntersectWith(this ref NativeParallelHashSet container, NativeHashSet.ReadOnly other) where T : unmanaged, IEquatable { var result = new UnsafeList(container.Count(), Allocator.Temp); foreach (var item in other) { if (container.Contains(item)) { result.Add(item); } } container.Clear(); container.UnionWith(result); result.Dispose(); } /// /// Adds all distinct values from the other collection to this set. /// Does not throw if a value is already in this set. /// /// The type of values. /// The set to add values to. /// The collection to copy values from. public static void UnionWith(this ref NativeParallelHashSet container, NativeHashSet.ReadOnly other) where T : unmanaged, IEquatable { foreach (var item in other) { container.TryAdd(item); } } /// /// Removes the values from this set which are also present in another collection. /// /// The type of values. /// The set to remove values from. /// The collection to compare with. public static void ExceptWith(this ref NativeParallelHashSet container, NativeParallelHashSet other) where T : unmanaged, IEquatable { foreach (var item in other) { container.Remove(item); } } /// /// Removes the values from this set which are absent in another collection. /// /// The type of values. /// The set to remove values from. /// The collection to compare with. public static void IntersectWith(this ref NativeParallelHashSet container, NativeParallelHashSet other) where T : unmanaged, IEquatable { var result = new UnsafeList(container.Count(), Allocator.Temp); foreach (var item in other) { if (container.Contains(item)) { result.Add(item); } } container.Clear(); container.UnionWith(result); result.Dispose(); } /// /// Adds all distinct values from the other collection to this set. /// Does not throw if a value is already in this set. /// /// The type of values. /// The set to add values to. /// The collection to copy values from. public static void UnionWith(this ref NativeParallelHashSet container, NativeParallelHashSet other) where T : unmanaged, IEquatable { foreach (var item in other) { container.TryAdd(item); } } /// /// Removes the values from this set which are also present in another collection. /// /// The type of values. /// The set to remove values from. /// The collection to compare with. public static void ExceptWith(this ref NativeParallelHashSet container, NativeParallelHashSet.ReadOnly other) where T : unmanaged, IEquatable { foreach (var item in other) { container.Remove(item); } } /// /// Removes the values from this set which are absent in another collection. /// /// The type of values. /// The set to remove values from. /// The collection to compare with. public static void IntersectWith(this ref NativeParallelHashSet container, NativeParallelHashSet.ReadOnly other) where T : unmanaged, IEquatable { var result = new UnsafeList(container.Count(), Allocator.Temp); foreach (var item in other) { if (container.Contains(item)) { result.Add(item); } } container.Clear(); container.UnionWith(result); result.Dispose(); } /// /// Adds all distinct values from the other collection to this set. /// Does not throw if a value is already in this set. /// /// The type of values. /// The set to add values to. /// The collection to copy values from. public static void UnionWith(this ref NativeParallelHashSet container, NativeParallelHashSet.ReadOnly other) where T : unmanaged, IEquatable { foreach (var item in other) { container.TryAdd(item); } } /// /// Removes the values from this set which are also present in another collection. /// /// The type of values. /// The set to remove values from. /// The collection to compare with. public static void ExceptWith(this ref NativeParallelHashSet container, NativeList other) where T : unmanaged, IEquatable { foreach (var item in other) { container.Remove(item); } } /// /// Removes the values from this set which are absent in another collection. /// /// The type of values. /// The set to remove values from. /// The collection to compare with. public static void IntersectWith(this ref NativeParallelHashSet container, NativeList other) where T : unmanaged, IEquatable { var result = new UnsafeList(container.Count(), Allocator.Temp); foreach (var item in other) { if (container.Contains(item)) { result.Add(item); } } container.Clear(); container.UnionWith(result); result.Dispose(); } /// /// Adds all distinct values from the other collection to this set. /// Does not throw if a value is already in this set. /// /// The type of values. /// The set to add values to. /// The collection to copy values from. public static void UnionWith(this ref NativeParallelHashSet container, NativeList other) where T : unmanaged, IEquatable { foreach (var item in other) { container.TryAdd(item); } } } }