Ejemplo n.º 1
0
        public Bag <Entity> GetEntities(Aspect aspect)
        {
            var entitiesBag = new Bag <Entity>();

            for (int index = 0; index < ActiveEntities.Count; ++index)
            {
                var entity = ActiveEntities.Get(index);
                if (entity != null && aspect.Interests(entity))
                {
                    entitiesBag.Add(entity);
                }
            }

            return(entitiesBag);
        }
Ejemplo n.º 2
0
 public bool IsActive(int entityId)
 {
     return(ActiveEntities.Get(entityId) != null);
 }
Ejemplo n.º 3
0
        public Entity GetEntity(int entityId)
        {
            Debug.Assert(entityId >= 0, "Id must be at least 0.");

            return(ActiveEntities.Get(entityId));
        }