diff --git a/src/EcsAspect.cs b/src/EcsAspect.cs index 3515fd5..42632bc 100644 --- a/src/EcsAspect.cs +++ b/src/EcsAspect.cs @@ -29,7 +29,7 @@ namespace DCFApixels.DragonECS #region Builder protected virtual void Init(Builder b) { } - public sealed class Builder : EcsAspectBuilderBase + public sealed class Builder { private EcsWorld _world; private EcsMask.Builder _maskBuilder; @@ -87,17 +87,17 @@ namespace DCFApixels.DragonECS } #region Include/Exclude/Optional/Combine - public sealed override TPool Include() + public TPool Include() where TPool : IEcsPoolImplementation, new() { IncludeImplicit(typeof(TPool).GetGenericArguments()[0]); return _world.GetPool(); } - public sealed override TPool Exclude() + public TPool Exclude() where TPool : IEcsPoolImplementation, new() { ExcludeImplicit(typeof(TPool).GetGenericArguments()[0]); return _world.GetPool(); } - public sealed override TPool Optional() + public TPool Optional() where TPool : IEcsPoolImplementation, new() { return _world.GetPool(); } @@ -390,13 +390,4 @@ namespace DCFApixels.DragonECS } #endregion } - - #region BuilderBase - public abstract class EcsAspectBuilderBase - { - public abstract TPool Include() where TPool : IEcsPoolImplementation, new(); - public abstract TPool Exclude() where TPool : IEcsPoolImplementation, new(); - public abstract TPool Optional() where TPool : IEcsPoolImplementation, new(); - } - #endregion } diff --git a/src/Pools/EcsHybridPool.cs b/src/Pools/EcsHybridPool.cs index 2009d88..e75b73c 100644 --- a/src/Pools/EcsHybridPool.cs +++ b/src/Pools/EcsHybridPool.cs @@ -254,17 +254,17 @@ namespace DCFApixels.DragonECS } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static EcsHybridPool Include(this EcsAspectBuilderBase self) where T : IEcsHybridComponent + public static EcsHybridPool Include(this EcsAspect.Builder self) where T : IEcsHybridComponent { return self.Include>(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static EcsHybridPool Exclude(this EcsAspectBuilderBase self) where T : IEcsHybridComponent + public static EcsHybridPool Exclude(this EcsAspect.Builder self) where T : IEcsHybridComponent { return self.Exclude>(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static EcsHybridPool Optional(this EcsAspectBuilderBase self) where T : IEcsHybridComponent + public static EcsHybridPool Optional(this EcsAspect.Builder self) where T : IEcsHybridComponent { return self.Optional>(); } @@ -283,17 +283,17 @@ namespace DCFApixels.DragonECS } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static EcsHybridPool IncludeHybrid(this EcsAspectBuilderBase self) where T : IEcsHybridComponent + public static EcsHybridPool IncludeHybrid(this EcsAspect.Builder self) where T : IEcsHybridComponent { return self.Include>(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static EcsHybridPool ExcludeHybrid(this EcsAspectBuilderBase self) where T : IEcsHybridComponent + public static EcsHybridPool ExcludeHybrid(this EcsAspect.Builder self) where T : IEcsHybridComponent { return self.Exclude>(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static EcsHybridPool OptionalHybrid(this EcsAspectBuilderBase self) where T : IEcsHybridComponent + public static EcsHybridPool OptionalHybrid(this EcsAspect.Builder self) where T : IEcsHybridComponent { return self.Optional>(); } diff --git a/src/Pools/EcsPool.cs b/src/Pools/EcsPool.cs index cc69c74..e7c43b7 100644 --- a/src/Pools/EcsPool.cs +++ b/src/Pools/EcsPool.cs @@ -239,17 +239,17 @@ namespace DCFApixels.DragonECS } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static EcsPool Include(this EcsAspectBuilderBase self) where TComponent : struct, IEcsComponent + public static EcsPool Include(this EcsAspect.Builder self) where TComponent : struct, IEcsComponent { return self.Include>(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static EcsPool Exclude(this EcsAspectBuilderBase self) where TComponent : struct, IEcsComponent + public static EcsPool Exclude(this EcsAspect.Builder self) where TComponent : struct, IEcsComponent { return self.Exclude>(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static EcsPool Optional(this EcsAspectBuilderBase self) where TComponent : struct, IEcsComponent + public static EcsPool Optional(this EcsAspect.Builder self) where TComponent : struct, IEcsComponent { return self.Optional>(); } diff --git a/src/Pools/EcsTagPool.cs b/src/Pools/EcsTagPool.cs index 834aa14..92218d5 100644 --- a/src/Pools/EcsTagPool.cs +++ b/src/Pools/EcsTagPool.cs @@ -213,17 +213,17 @@ namespace DCFApixels.DragonECS } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static EcsTagPool Include(this EcsAspectBuilderBase self) where TTagComponent : struct, IEcsTagComponent + public static EcsTagPool Include(this EcsAspect.Builder self) where TTagComponent : struct, IEcsTagComponent { return self.Include>(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static EcsTagPool Exclude(this EcsAspectBuilderBase self) where TTagComponent : struct, IEcsTagComponent + public static EcsTagPool Exclude(this EcsAspect.Builder self) where TTagComponent : struct, IEcsTagComponent { return self.Exclude>(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static EcsTagPool Optional(this EcsAspectBuilderBase self) where TTagComponent : struct, IEcsTagComponent + public static EcsTagPool Optional(this EcsAspect.Builder self) where TTagComponent : struct, IEcsTagComponent { return self.Optional>(); } @@ -242,17 +242,17 @@ namespace DCFApixels.DragonECS } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static EcsTagPool IncludeTag(this EcsAspectBuilderBase self) where TTagComponent : struct, IEcsTagComponent + public static EcsTagPool IncludeTag(this EcsAspect.Builder self) where TTagComponent : struct, IEcsTagComponent { return self.Include>(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static EcsTagPool ExcludeTag(this EcsAspectBuilderBase self) where TTagComponent : struct, IEcsTagComponent + public static EcsTagPool ExcludeTag(this EcsAspect.Builder self) where TTagComponent : struct, IEcsTagComponent { return self.Exclude>(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static EcsTagPool OptionalTag(this EcsAspectBuilderBase self) where TTagComponent : struct, IEcsTagComponent + public static EcsTagPool OptionalTag(this EcsAspect.Builder self) where TTagComponent : struct, IEcsTagComponent { return self.Optional>(); }