public void Change(Entity e) {
			bool contains = (systemBit & e.GetSystemBits()) == systemBit;
			bool interest = (typeFlags & e.GetTypeBits()) == typeFlags;
	
			if (interest && !contains && typeFlags > 0) {
				actives.Add(e.GetId(),e);
				e.AddSystemBit(systemBit);
				Added(e);
			} else if (!interest && contains && typeFlags > 0) {
				Remove(e);
			}
		}
Example #2
0
        /// <summary>Adds the specified entity.</summary>
        /// <param name="entity">The entity.</param>
        protected void Add(Entity entity)
        {
            Debug.Assert(entity != null, "Entity must not be null.");

            entity.AddSystemBit(this.SystemBit);
            if (entity.IsEnabled)
            {
                this.Enable(entity);
            }

            this.OnAdded(entity);
        }
Example #3
0
 protected void Add(Entity e)
 {
     System.Diagnostics.Debug.Assert(e != null);
     e.AddSystemBit(systemBit);
     if (e.Enabled == true) {
         Enable(e);
     }
     Added(e);
 }
 protected void Add(Entity e)
 {
     e.AddSystemBit(systemBit);
     if (e.Enabled == true) {
         Enable(e);
     }
     Added(e);
 }
        private void Add(Entity entity)
        {
            Assert.False(_entities.Contains(entity) || entity.SystemMask.HasBits(this.SystemBit));

            _entities.Add(entity); // assume that doesn't contain, shouldn't be possible
            entity.AddSystemBit(this.SystemBit);
            this.OnEntityAdded(entity);
        }