public AspectPromise Copy()
 {
     AspectPromise b = new AspectPromise();
     b.allTypes.AddRange(allTypes);
     b.exclusionTypes.AddRange(exclusionTypes);
     b.oneTypes.AddRange(oneTypes);
     return b;
 }
        private EntitySubscription CreateSubscription(AspectPromise builder)
        {
            EntitySubscription entitySubscription = new EntitySubscription(World, builder);
            subscriptionMap[builder] = entitySubscription;
            subscriptions.Add(entitySubscription);

            World.EntityManager.Synchronize(entitySubscription);

            return entitySubscription;
        }
        public EntitySubscription(World world, AspectPromise builder)
        {
            aspect = builder.Build(world);
            promise = builder;
            aspectCache = new BitSet();
            em = world.EntityManager;

            activeEntityIds = new BitSet();
            entities = new Bag<int>();

            listeners = new Bag<ISubscriptionListener>();

            insertedIds = new BitSet();
            removedIds = new BitSet();

            inserted = new Bag<int>();
            removed = new Bag<int>();
        }
 /**
  * Get subscription to all entities matching {@link Aspect}.
  *
  * Will create a new subscription if not yet available for
  * given {@link Aspect} match.
  *
  * @param builder Aspect to match.
  * @return {@link EntitySubscription} for aspect.
  */
 public EntitySubscription Get(AspectPromise builder)
 {
     return ( subscriptionMap.ContainsKey(builder) ) ? subscriptionMap[builder] : this.CreateSubscription(builder);
 }