diff --git a/src/EcsGroup.cs b/src/EcsGroup.cs index 7542435..65c1fb5 100644 --- a/src/EcsGroup.cs +++ b/src/EcsGroup.cs @@ -342,9 +342,9 @@ namespace DCFApixels.DragonECS AddInternal(item); } } - public void UnionWithRange(IEnumerable otherRange) + public void UnionWithRange(IEnumerable range) { - foreach (var item in otherRange) + foreach (var item in range) { if (!Has(item)) AddInternal(item); @@ -408,12 +408,12 @@ namespace DCFApixels.DragonECS RemoveInternal(item); } } - public void ExceptWithRange(IEnumerable otherRange) + public void ExceptWithRange(IEnumerable range) { - foreach (var item in otherRange) + foreach (var item in range) { - if (!Has(item)) - AddInternal(item); + if (Has(item)) + RemoveInternal(item); } } #endregion @@ -720,4 +720,58 @@ namespace DCFApixels.DragonECS } #endregion } + +#if false + public static class EcsGroupAliases + { + /// Alias for UnionWith + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void Add(this EcsGroup self, EcsGroup group) + { + self.UnionWith(group); + } + /// Alias for UnionWith + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void Add(this EcsGroup self, EcsReadonlyGroup group) + { + self.UnionWith(group); + } + /// Alias for ExceptWith + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void Remove(this EcsGroup self, EcsGroup group) + { + self.ExceptWith(group); + } + /// Alias for ExceptWith + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void Remove(this EcsGroup self, EcsReadonlyGroup group) + { + self.ExceptWith(group); + } + /// Alias for SymmetricExceptWith + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void Xor(this EcsGroup self, EcsGroup group) + { + self.SymmetricExceptWith(group); + } + /// Alias for SymmetricExceptWith + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void Xor(this EcsGroup self, EcsReadonlyGroup group) + { + self.SymmetricExceptWith(group); + } + /// Alias for IntersectWith + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void And(this EcsGroup self, EcsGroup group) + { + self.IntersectWith(group); + } + /// Alias for IntersectWith + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void And(this EcsGroup self, EcsReadonlyGroup group) + { + self.IntersectWith(group); + } + } +#endif } \ No newline at end of file