Exemplo n.º 1
0
 public static void RemoveEntities(this IEntityCollection entityCollection, params IEntity[] entities)
 {
     for (var i = 0; i < entities.Length; i++)
     {
         entityCollection.RemoveEntity(entities[i].Id);
     }
 }
Exemplo n.º 2
0
 public static void RemoveEntities(this IEntityCollection entityCollection, IEnumerable <IEntity> entities)
 {
     foreach (var entity in entities)
     {
         entityCollection.RemoveEntity(entity.Id);
     }
 }
Exemplo n.º 3
0
 public static void RemoveEntities(this IEntityCollection entityCollection, params IEntity[] entities)
 {
     foreach (var entity in entities)
     {
         entityCollection.RemoveEntity(entity.Id);
     }
 }
Exemplo n.º 4
0
 public void RemoveUI(IEntity ui)
 {
     if (ui != null)
     {
         defaultConllection.RemoveEntity(ui.Id);
         eventSystem.Publish(new UIRemovedEvent(ui));
     }
 }
Exemplo n.º 5
0
        public static void RemoveEntities(this IEntityCollection entityCollection, Func <IEntity, bool> predicate)
        {
            var entities = entityCollection.Where(predicate).ToArray();

            for (var i = 0; i < entities.Length; i++)
            {
                entityCollection.RemoveEntity(entities[i].Id);
            }
        }
Exemplo n.º 6
0
        public static void RemoveAllEntities(this IEntityCollection entityCollection)
        {
            var entities = entityCollection.ToArray();

            for (var i = 0; i < entities.Length; i++)
            {
                entityCollection.RemoveEntity(entities[i].Id);
            }
        }
Exemplo n.º 7
0
        public static void RemoveEntities(this IEntityCollection entityCollection, Func <IEntity, bool> predicate)
        {
            var entities = entityCollection.Where(predicate).ToArray();

            foreach (var entity in entities)
            {
                entityCollection.RemoveEntity(entity.Id);
            }
        }
Exemplo n.º 8
0
        public static void RemoveAllEntities(this IEntityCollection entityCollection)
        {
            var entities = entityCollection.ToArray();

            foreach (var entity in entities)
            {
                entityCollection.RemoveEntity(entity.Id);
            }
        }
 public virtual void RemoveEntityFromContainer(IEntity ent)
 {
     if (m_entityCollection != null)
     {
         m_entityCollection.RemoveEntity(ent);
         if (m_entityCollection.Count == 0)
         {
             m_entityCollection = null;
         }
     }
 }
Exemplo n.º 10
0
        public static void RemoveEntitiesContaining(this IEntityCollection entityCollection, params Type[] components)
        {
            var entities = entityCollection
                           .Where(entity => components.Any(x => entity.HasAllComponents(x)))
                           .ToArray();

            for (var i = 0; i < entities.Length; i++)
            {
                entityCollection.RemoveEntity(entities[i].Id);
            }
        }
Exemplo n.º 11
0
        public static void RemoveEntitiesContaining(this IEntityCollection entityCollection, params Type[] components)
        {
            var entities = entityCollection
                           .Where(entity => components.Any(type => entity.HasAllComponents(type)))
                           .ToArray();

            foreach (var entity in entities)
            {
                entityCollection.RemoveEntity(entity.Id);
            }
        }
Exemplo n.º 12
0
        public static void RemoveEntitiesContaining <T>(this IEntityCollection entityCollection)
            where T : class, IComponent
        {
            var entities = entityCollection
                           .Where(entity => entity.HasComponent <T>())
                           .ToArray();

            for (var i = 0; i < entities.Length; i++)
            {
                entityCollection.RemoveEntity(entities[i].Id);
            }
        }
Exemplo n.º 13
0
        public static void RemoveEntitiesContaining <T>(this IEntityCollection entityCollection)
            where T : class, IComponent
        {
            var entities = entityCollection
                           .Where(entity => entity.HasComponent <T>())
                           .ToArray();

            foreach (var entity in entities)
            {
                entityCollection.RemoveEntity(entity.Id);
            }
        }
Exemplo n.º 14
0
 public void Process(IEntity entity)
 {
     _defaultCollection.RemoveEntity(entity.Id);
 }